title: Custom verbatim that sets all spaces (" ") as visible spaces ("␣") that can line-break

text: It makes sense to typeset code in a monospaced font. Sometimes such code needs to be embedded in a paragraph context, and then it will be useful to allow it to linebreak. In order to visualize spaces properly, **I would like a macro`\code` that typesets its argument with all spaces replaced by visible spaces that can line-break (on both sides)**. For example, it'd typeset               \code{string with  spaces}      as `string␣with␣␣spaces` where each `␣` can linebreak on either side. As my question is about code that is to be embedded in paragraph text, we can assume that the argument to such a `\code` macro won't contain any paragraph breaks. Actually my use case is more specific. I typeset string constants using the macro `\strC` shown below. This might still be interesting to others, as it is a bit more than just a variation on `\verb`, with the custom `\textsl` potentially complicating the solution. I presently use an explicit call to a macro `\vsp` (simply defined as `\allowbreak\textvisiblespace\allowbreak`; both `\allowbreak`s are needed) as a workaround, but it would be nice to be able to just type (one or more) spaces inside the macro argument.               \documentclass{article}          \newcommand*{\strC}[1]{\textnormal{`\textsl{\texttt{#1}}'}} % string constant     \newcommand*{\vsp}{\allowbreak\textvisiblespace\allowbreak} % visible space          \begin{document}          \hspace*{31em}\strC{hello world}     % linebreaks as:  ‘hello / world’    (space disappears)          \hspace*{31em}\strC{hello\textvisiblespace{}world}     % linebreaks as:  ‘hello␣world’ / ∅  (no linebreak)          \hspace*{31em}\strC{hello\vsp{}world}     % linebreaks as:  ‘hello / ␣world’   (as intended; a linebreak after ␣ would also be ok)          \end{document}      For this code specifically the idea would be to type `\strC{hello world}` but to get the same result as with `\strC{hello\vsp{}world}`. Multiple typed spaces should yield multiple `␣`-characters; a string `␣␣␣␣␣` may break anywhere (beginning, anywhere in the middle, end). Here is a related question also asking about functional conversion of input (in this case for the specific purpose of pasting). * * * **Summary of answers:** Both answers are very good, and the comment pair (just below) by user cacamailg is very good too, but no solution as of the time of this edit is perfect. For now I'll stick with my manual `\vsp` macro, which is quick to type and gives me full control. If someone has a refinement of one of the three approaches that is flawless, I'll accept that as the answer.


title: Removing Subordinated Headline Levels From The ToC Automatically When Using `*`

text: Usually, when you use `section*{}`only the section will be removed from the toc. In order to remove subordinated subsections you have to add the `*`. Is it possible to define a command that removes subordinated levels automatically when you remove higher level headlines from the toc? This could save some time. In the document:               \section*{}     \subsection{}      With the desired adjustment both (the section and the subsection) would be removed -- even though only the section is provided with the `*`. An ideal solution would be able to remove all subordinated levels regardless of whether they are used for parts, sections, subsections, subsubsections, paragraphs etc.


title: how to remove pgfplots circular points

text: In the graph below, there are large circular point marks. Is there a way of removing them? My graph code is               \begin{figure}[H]      \begin{tikzpicture}      \begin{axis}[      height=9cm,      width=12cm,      grid=major,      xlabel={Levels},     ylabel={Speed},     legend style={     cells={anchor=east},     legend pos=outer north east,     }]      ![enter image description here](http://i.stack.imgur.com/pPh4e.png)


title: inserting png introduces inputenc error

text: I want to write an article in Chinese, which needs to insert pictures. It's fine when I insert pictures as `.pdf` but the following problem occurs if `.png` is inserted:               ! Package inputenc Error: Unicode char \u 8:实 not set up for use with LaTeX.      That is a Chinese character. I compile with `pdflatex` and here is the snippet that is related to the issue:               \documentclass[12pt, a4paper]{article}          \usepackage{listings}     \usepackage{graphicx}     \usepackage{CJKutf8}     \usepackage[bookmarks=true, unicode=true, colorlinks=true, linkcolor=blue]{hyperref}     \lstset{basicstyle=\large, showstringspaces=false}          \begin{document}     \begin{CJK}{UTF8}{gbsn}          \cleardoublepage     \pdfbookmark[1]{\contentsname}{toc}     \tableofcontents     \newpage          \section{实验设计}     \begin{figure}[ht]     \centering     \includegraphics[width=0.9\textwidth]{schema}     \end{figure}          ...      schema is the picture name. I have to work around this because the `.pdf` picture will take up the whole page. Update: It appears to me that the problem has nothing to do with `inputenc` package. Although the problem seem to have been solved yesterday after I included the package, it has been weirdly compiling successfully even I exclude it (looking back, it's because I added more characters). LaTeX complains again after I change the picture floating option, i.e.               \begin{figure}[!h]     \centering     \includegraphics[width=0.9\textwidth]{schema}     \end{figure}      Now I guess it's owing to the way Chinese characters mingle with pictures. **Something I forgot to mention thus far** : The problem appears on second run and the error is in the `*.toc` file and it goes away after `\tableofcontents` is commented out. Any thoughts or solutions on this? **One more thing** : moving to xelatex has solved the problem to some extent. One more issue is the bookmark is not printed correctly in Chinese character. I've googled a lot but found no satisfactory solution yet. I'm afraid I have to move back if that cannot be handled.


title: LaTeX beamer: Align text in the bottom of a frame and cut too long text at the top

text: I would like to align everything of an in steps appearing text on a LaTeX beamer frame on its bottom and if there is to much text so that it would not fit on the frame just cut it at the top. The last lines should be always shown. I guess that it is possible with some box tricks, but I cannot find the solution. I have tried things like               \documentclass{beamer}     \begin{document}     \begin{frame}[<+->]     \begin{minipage}[t][\textheight]{\textwidth}     \vfill          test a\par\pause     test b\par\pause     test c\par\pause     test d\par\pause     test e\par\pause     test f\par\pause     test g\par\pause     test h\par\pause     test i\par\pause     test j\par\pause     \end{minipage}     \end{frame}     \end{document}      But there are two problems with this: First of all, because of the usage of \pause it does not align everything on the bottom but just such that the last page is really bottom aligned (It works with \only<1->, \only<2-> etc.) but I cannot use this because I want an extra command (defined by \newcommand) to display "test ..." in a special formatting defined by its contents and I do not know which number i I am currently at to use in               \only<i->      ). And the second one is that it does not cut off at the top then there are to many lines to display. I would be very grateful for some help.


title: How to add equations on top of arrows?

text: I have the following matrix:               $$     \left[     \begin{array}{ccc|c}     -4&2&-2&10 \\ 1&0&1&-3 \\ 3&-1&1&-8     \end{array}     \right]     \sim     $$      I want to have something like this: ![enter image description here](http://i.stack.imgur.com/gaPs0.png) How shall I add equations on top of the `~` and make these align? Thanks!


title: Axis font size in pgf plots when using a large set of data

text: I am trying to plot a large set of data from a .dat file. The following is my code. I can plot the data using this code. But, I am not able to increase the size of the fonts used in the axis labels and title. I used I am using texworks and I use Lualatex to compile the code since the data is too large. Unfortunately, I am not able to attach the data file. I am new to latex and pgfplots, any help would be appreciated.               \documentclass[landscape]{article}     \usepackage{tikz}     \usetikzlibrary{external}     \newenvironment{mytikz}{\begin{figure}[htp]     \centering     \begin{tikzpicture}}     {\end{tikzpicture}     \caption{}     \end{figure}}          \usepackage[active,tightpage]{preview}     \PreviewEnvironment{center}     \renewcommand{\PreviewBbAdjust}{0pt 0pt 0pt 0pt}     \usepackage[margin=0em]{geometry}     \usepackage[utf8]{inputenc}     \usepackage[english]{babel}     \usepackage{graphicx}     \usepackage{pgfplots}     \pgfplotsset{compat=1.8}          \begin{document}               \begin{mytikz}     \begin{center}     \begin{tikzpicture}     \begin{axis}[         xlabel={Voltage ($V$)},         ylabel={Current ($A$)},         width=0.8\paperwidth, height=0.8\paperheight,]             \addplot [         color=black,         solid,         mark=diamond*,         mark options={red}]         table [col sep=comma]{Index_7_data_a.dat};         \addplot [         color=black,         solid,         mark=*,         mark options={blue}]         table [col sep=comma]{Index_7_data_b.dat};         \addplot [         color=black,         solid,         mark=pentagon*,         mark options={green}]         table [col sep=comma]{Index_7_data_c.dat};     %% Add a legend %%          \addlegendentry{$Phase A$};     \addlegendentry{$Phase B$};     \addlegendentry{$Phase C$};          \end{axis}          \end{tikzpicture}     \end{center}     \end{mytikz}          \end{document}


title: @webpage fields in BibTeX

text: For a BibTeX `@webpage` entry, what fields are mandatory, and what fields are optional? I've tried to Google for an absolute reference for this, but can't seem to locate one.


title: Overline in text mode, Background Color

text: I've got the following code below to mimic a TI83 Calculator screen, but I'm stuck on adding a couple of things I'd like to add.   1. I'd like to make the `\overline{x}` in text mode. I tried `\={x}`, and although that works in LaTeX, it doesn't work on our system. Any other ideas on how I can produce an overline over `x` in text mode?   2. I'd also like to try to take this:               \def\input{\calcinput{\ Inpt:Data\ Stats}}      and put the word `Stats` in the color white with a solid black background behind it. Any thoughts?               \documentclass[11pt]{scrartcl}      \usepackage{tikz}     \usepackage{xparse}     \newcommand\tsurd{\ensuremath{\sqrt{\phantom{i}}}}     \newcommand\txbar{\ensuremath{\overline{x}}}     \ExplSyntaxOn     \NewDocumentCommand{\calcinput}{m}     {      \tl_map_inline:nn { #1 } { ##1 \hspace{0pt} }     }     \ExplSyntaxOff          \begin{document}          \def\tinterval{\calcinput{TInterval}}     \def\input{\calcinput{\ Inpt:Data\ Stats}}     \def\xbar{\calcinput{\ \txbar:10}}     \def\s{\calcinput{\ Sx:2.345678}}     \def\n{\calcinput{\ n:12}}     \def\cl{\calcinput{\ C-Level:0.95}}     \def\calc{\calcinput{\ Calculate}}               \begin{center}     \begin{tikzpicture}[font=\large\ttfamily]     \draw (0,0) rectangle (5,-4);     \node[align=flush left,text width =5cm,          anchor=north west,inner sep=1pt] (tinterval) {\tinterval};     \node[align=flush left,text width =5cm,          anchor=north west,inner sep=1pt] (input) at (tinterval.south west) {\input};     \node[align=flush left,text width =5cm,          anchor=north west,inner sep=1pt] (xbar) at (input.south west) {\xbar};     \node[align=flush left,text width =5cm,          anchor=north west,inner sep=1pt] (s) at (xbar.south west) {\s};     \node[align=flush left,text width =5cm,          anchor=north west,inner sep=1pt] (n) at (s.south west) {\n};     \node[align=flush left,text width =5cm,          anchor=north west,inner sep=1pt] (cl) at (n.south west) {\cl};     \node[align=flush left,text width =5cm,          anchor=north west,inner sep=1pt] (calc) at (cl.south west) {\calc};     \end{tikzpicture}     \end{center}     \end{document}


title: 'Questions about my cv and cover letter' revisited, changing number of lines in address

text: I'm using Gonzalo Medina's answer in this question: Questions about my cv header and cover letter and the code is reproduced as follows:               \documentclass[11pt,a4paper]{moderncv}     \moderncvtheme[green]{classic}                       \usepackage[utf8]{inputenc}                       \usepackage{floatflt}     \usepackage{fancyhdr}      \usepackage{geometry}     \geometry{a4paper,left=2cm,right=1cm, top=2cm, bottom=1.5cm,headheight=21pt}      \usepackage{tikz}      \usepackage{wrapfig}     \usepackage{lipsum}           % Suppress final dot in \cventry     \renewcommand*\cventry[7][.25em]{%       \cvitem[#1]{#2}{%         {\bfseries#3}%         \ifthenelse{\equal{#4}{}}{}{, {\slshape#4}}%         \ifthenelse{\equal{#5}{}}{}{, #5}%         \ifthenelse{\equal{#6}{}}{}{, #6}%         \strut%         \ifx&#7&%           \else{\newline{}\begin{minipage}[t]{\linewidth}\small#7\end{minipage}}\fi}}          % New page style     \fancypagestyle{myfancy}{     \fancyhead[L]{\parbox[t]{.3333\textwidth}{\sffamily\footnotesize       Address Line 1\\Address Line 2}}     \fancyhead[C]{\parbox[t]{.3333\textwidth}{\fixedphonesymbol\sffamily\footnotesize  555-123-456-789}}     \fancyhead[R]{\parbox[t]{.3333\textwidth}{\emailsymbol\sffamily\footnotesize  abcd@tex.stackexchange.com}}     }     \makeatletter     \let\ps@plain\ps@myfancy     \let\ps@empty\ps@myfancy     \makeatother     \pagestyle{myfancy}          % Redefinitions of \makecvtitle, opening and closing to     % have the desired formatting for first and family names     \makeatletter     \renewcommand*{\makecvtitle}{%       % recompute lengths (in case we are switching from letter to resume, or vice versa)       \recomputecvlengths%       % optional detailed information (pre-rendering)       \def\phonesdetails{}%       \collectionloop{phones}{% the key holds the phone type (=symbol command prefix), the item holds the number         \protected@edef\phonesdetails{\phonesdetails\protect\makenewline\csname\collectionloopkey phonesymbol\endcsname\collectionloopitem}}%       \def\socialsdetails{}%       \collectionloop{socials}{% the key holds the social type (=symbol command prefix), the item holds the link         \protected@edef\socialsdetails{\socialsdetails\protect\makenewline\csname\collectionloopkey socialsymbol\endcsname\collectionloopitem}}%       \newbox{\makecvtitledetailsbox}%       \savebox{\makecvtitledetailsbox}{%         \addressfont\color{color2}%         \begin{tabular}[b]{@{}r@{}}%           \ifthenelse{\isundefined{\@addressstreet}}{}{\makenewline\addresssymbol\@addressstreet%             \ifthenelse{\equal{\@addresscity}{}}{}{\makenewline\@addresscity}% if \addresstreet is defined, \addresscity and addresscountry will always be defined but could be empty             \ifthenelse{\equal{\@addresscountry}{}}{}{\makenewline\@addresscountry}}%           \phonesdetails% needs to be pre-rendered as loops and tabulars seem to conflict           \ifthenelse{\isundefined{\@email}}{}{\makenewline\emailsymbol\emaillink{\@email}}%           \ifthenelse{\isundefined{\@homepage}}{}{\makenewline\homepagesymbol\httplink{\@homepage}}%           \socialsdetails% needs to be pre-rendered as loops and tabulars seem to conflict           \ifthenelse{\isundefined{\@extrainfo}}{}{\makenewline\@extrainfo}%         \end{tabular}       }%       % optional photo (pre-rendering)       \newbox{\makecvtitlepicturebox}%       \savebox{\makecvtitlepicturebox}{%         \ifthenelse{\isundefined{\@photo}}%         {}%         {%           \hspace*{\separatorcolumnwidth}%           \color{color1}%           \setlength{\fboxrule}{\@photoframewidth}%           \ifdim\@photoframewidth=0pt%             \setlength{\fboxsep}{0pt}\fi%           \framebox{\includegraphics[width=\@photowidth]{\@photo}}}}%       % name and title       \newlength{\makecvtitledetailswidth}\settowidth{\makecvtitledetailswidth}{\usebox{\makecvtitledetailsbox}}%       \newlength{\makecvtitlepicturewidth}\settowidth{\makecvtitlepicturewidth}{\usebox{\makecvtitlepicturebox}}%       \ifthenelse{\lengthtest{\makecvtitlenamewidth=0pt}}% check for dummy value (equivalent to \ifdim\makecvtitlenamewidth=0pt)         {\setlength{\makecvtitlenamewidth}{\textwidth-\makecvtitledetailswidth-\makecvtitlepicturewidth}}%         {}%       \begin{minipage}[b]{\makecvtitlenamewidth}%         \namestyle{\@firstname}\par\smallskip\namestyle{\@lastname}%         \ifthenelse{\equal{\@title}{}}{}{\\[1.25em]\titlestyle{\@title}}%       \end{minipage}%       \hfill%       % optional detailed information (rendering)       \llap{\usebox{\makecvtitledetailsbox}}% \llap is used to suppress the width of the box, allowing overlap if the value of makecvtitlenamewidth is forced       % optional photo (rendering)       \usebox{\makecvtitlepicturebox}\\[2.5em]%       % optional quote       \ifthenelse{\isundefined{\@quote}}%         {}%         {{\centering\begin{minipage}{\quotewidth}\centering\quotestyle{\@quote}\end{minipage}\\[2.5em]}}%       \par}% to avoid weird spacing bug at the first section if no blank line is left after \makecvtitle     \renewcommand*{\makeletterclosing}{       \@closing\\[3em]%       {\bfseries\@firstname\\\@lastname}%       \ifthenelse{\isundefined{\@enclosure}}{}{%         \\%         \vfill%         {\color{color2}\itshape\enclname: \@enclosure}}}     \renewcommand*{\makelettertitle}{%       % recompute lengths (in case we are switching from letter to resume, or vice versa)       \recomputeletterlengths%       % sender contact info       \hfill%       \begin{minipage}{.5\textwidth}%         \raggedleft%         \addressfont\textcolor{color2}{%           {\bfseries\upshape\@firstname\\\@lastname}\@firstdetailselementfalse%           \ifthenelse{\isundefined{\@addressstreet}}{}{\makenewline\addresssymbol\@addressstreet%             \ifthenelse{\equal{\@addresscity}{}}{}{\makenewline\@addresscity}% if \addresstreet is defined, \addresscity and addresscountry will always be defined but could be empty             \ifthenelse{\equal{\@addresscountry}{}}{}{\makenewline\@addresscountry}}%           \collectionloop{phones}{% the key holds the phone type (=symbol command prefix), the item holds the number             \makenewline\csname\collectionloopkey phonesymbol\endcsname\collectionloopitem}%           \ifthenelse{\isundefined{\@email}}{}{\makenewline\emailsymbol\emaillink{\@email}}%           \ifthenelse{\isundefined{\@homepage}}{}{\makenewline\homepagesymbol\httplink{\@homepage}}%           \ifthenelse{\isundefined{\@extrainfo}}{}{\makenewline\@extrainfo}}%         \end{minipage}\\[1em]       % recipient block       \begin{minipage}[t]{.5\textwidth}         \raggedright%         \addressfont%         {\bfseries\upshape\@recipientname}\\%         \@recipientaddress%       \end{minipage}       % date       \hfill% US style     %  \\[1em]% UK style       \@date\\[2em]% US informal style: "January 1, 1900"; UK formal style: "01/01/1900"       % opening       \raggedright%       \@opening\\[1.5em]%       % ensure no extra spacing after \makelettertitle due to a possible blank line     %  \ignorespacesafterend% not working       \hspace{0pt}\par\vspace{-\baselineskip}\vspace{-\parskip}}          \makeatother          \makeatletter     \renewcommand*{\bibliographyitemlabel}{\@biblabel{\arabic{enumiv}}}     \makeatother          \firstname{Prename}     \familyname{Surname}     \title{Curriculum vitae}                   \address{}{}       \photo[128pt]{picture}                                  \begin{document}          \makecvtitle     born 99.11.999 in smallcity          \section{school education}          \cventry{1996- 2008}{Abitur}{School City}{}{}{grade: x,x}       \cventry{1996--2000}{elementary school}{}{}{}{Grundschule somewhere}     \section{studies}          \cventry{02.10.2011-- today}{matriculation Master of Science in xxx}{}{}{}{Joint Masters Program in whatever}     \cventry{07.04.2011}{finishing of Bachelor studies}{}{}{}{grade: x,x title: Bachelor of Science whatever}     \cventry{02.12.2010-01.02.2011}{student assistant}{}{}{}{Chair of xxx  Prof. Dr. xxx \newline student assistant as a tutor of xxx}     \cventry{21.07.2008--29.09.2011}{matriculation Bachelor of Science xxx}{}{}{}{university of xxx}     \section{Bachelor thesis}     \cvline{title}{\emph{Here comes a long title}}     \cvline{supervisor}{Prof. Dr. xxxxx}     \cvline{date}{february 2011}     \cvline{grade}{1.0}          \section{languages}     \cvlanguage{german}{mother tongue}{}     \cvlanguage{english}{fluent}{}          \section{technical knowledge}          \cvline{basic}{Stata, SPSS}     \cvline{expert}{R}          \cvline{miscellaneous}{LaTex, Microsoft Office, Microsoft Dynamics}                \clearpage          \begin{tikzpicture}[remember picture,overlay]     \draw[color1,line width=10pt]        ([yshift=-55pt]current page.north west) -- +(14cm,0pt);     \end{tikzpicture}     \recipient{HR Departmnet}{Corporation\\123 Pleasant Lane\\12345 City, State}      \date{\today}      \opening{Dear Sir or Madam,}      \closing{Sincerely yours,}      \enclosure[Attached]{curriculum vit\ae{}}           \makelettertitle           \lipsum[1-3]           \makeletterclosing          \end{document}      I am trying to change the address field so that it shows my name, street, suburb, city, country all on separate lines. I know that I have to change these blocks of code, but how?               \begin{tabular}[b]{@{}r@{}}%         \ifthenelse{\isundefined{\@addressstreet}}{}{\makenewline\addresssymbol\@addressstreet%         \ifthenelse{\equal{\@addresscity}{}}{}{\makenewline\@addresscity}% if \addresstreet is defined, \addresscity and addresscountry will always be defined but could be empty         \ifthenelse{\equal{\@addresscountry}{}}{}{\makenewline\@addresscountry}}%       \phonesdetails% needs to be pre-rendered as loops and tabulars seem to conflict       \ifthenelse{\isundefined{\@email}}{}{\makenewline\emailsymbol\emaillink{\@email}}%       \ifthenelse{\isundefined{\@homepage}}{}{\makenewline\homepagesymbol\httplink{\@homepage}}%       \socialsdetails% needs to be pre-rendered as loops and tabulars seem to conflict       \ifthenelse{\isundefined{\@extrainfo}}{}{\makenewline\@extrainfo}%     \end{tabular}      and                 \begin{minipage}{.5\textwidth}%         \raggedleft%         \addressfont\textcolor{color2}{%           {\bfseries\upshape\@firstname {} \@lastname}\@firstdetailselementfalse%           \ifthenelse{\isundefined{\@addressstreet}}{}{\makenewline\addresssymbol\@addressstreet%             \ifthenelse{\equal{\@addresscity}{}}{}{\makenewline\@addresscity}% if \addresstreet is defined, \addresscity and addresscountry will always be defined but could be empty             \ifthenelse{\equal{\@addresscountry}{}}{}{\makenewline\@addresscountry}}%           \collectionloop{phones}{% the key holds the phone type (=symbol command prefix), the item holds the number             \makenewline\csname\collectionloopkey phonesymbol\endcsname\collectionloopitem}%           \ifthenelse{\isundefined{\@email}}{}{\makenewline\emailsymbol\emaillink{\@email}}%           \ifthenelse{\isundefined{\@homepage}}{}{\makenewline\homepagesymbol\httplink{\@homepage}}%           \ifthenelse{\isundefined{\@extrainfo}}{}{\makenewline\@extrainfo}}%         \end{minipage}\\[1em]      I've tried doing it the logical way and added `\ifthenelse{\equal{\@addresssuburb}}{}{\makenewline\@addresssuburb%` between the lines related to street and city, but I get an error: `File ended while scanning use of \@argdef` (Am I just being dumb?) The idea is to put `\address{street name}{suburb}{city}{country}` in the document body so that my name, street, suburb, city, country would be shown on the top right-hand side of the first page of the cover letter and cv.


title: Insert the subsubsection number in the content part of a frame when using the beamer class

text: Is there a way to insert the `subsubsection` number in a frame when using the `beamer` class? I tried `\insertsubsubsection` number, to no avail. I would be glad if I get only the `subsubsection` number, or the complete toc number of the current `subsubsection`, e.g. 3.1.2 or 3.1.3. I know, `\subsubsection` is evil, but this is for a longer lecture and I need the `\subsubsection`. I am trying to insert the `subsubsection` number (the complete ) in the frametitle of every slide to give students a better overview. Any ideas?


title: Get a includegraphic to stick in the same place for several beamer slides

text: I am working with a presentation where I want a sequence of slides with a figure that changes slightly for each slide. I want the figure to to stay in the same place for many slides and I want to have text describing what happens. How can I do this? The text is of different lengths for each slide so the figure will move around. I am guessing I need some sort of command that allows me to specify both the width and height of a "box" where I can but whatever I want.


title: How to change fontsize of \cmpdref

text: I was using `chemstyle` package, but for some utilities I moved to `chemnum`. With `chemstyle` I used               \renewcommand*{\schemerefformat}{\fontsize{8pt}{8pt}\textbf{}}      in order to reduce the font size of numbers in schemes. I couldn't find this option or equal in `chemnum` which use `\cmpdref{key}` to label a molecule. Is there a way reduce the font size in `\cmpdref`?


title: Customizing enumerate item label

text: I have a list that looks like follows:               1 (a) Red Apple            (b) Blue Apple          2 (a) Red Orange            (b) Blue Orange      I want to say "(a) implies (b)." So I label items as follows:               \begin{enumerate}     \item \begin{enumerate}     \item Red Apple \label{red}     \item Blue Apple \label{blue}     \end{enumerate}     \item \begin{enumerate}     \item Red Orange     \item Blue Orange     \end{enumerate}     \end{enumerate}      When I write               \ref{red} implies \ref{blue}      it gives 1(a) implies 1(b). How can I get rid of the number 1 in front of (a) and (b)?


title: mdframed: Put a line below the frame title and give it a shaded background

text: I like to use `mdframed` to make a framed environment with an optional title. The title has to be in its own box with a gray background, like this: ![example](http://i.stack.imgur.com/374eY.jpg) I hope that this is possible. **MWE**               \documentclass{article}          \usepackage[framemethod=TikZ]{mdframed}     \newenvironment{Frame}[1][]{%         \begin{mdframed}[%             frametitle={#1},             skipabove=\baselineskip plus 2pt minus 1pt,             skipbelow=\baselineskip plus 2pt minus 1pt,             linewidth=0.5pt,         ]%     }{%         \end{mdframed}     }          \begin{document}     Text     \begin{Frame}[with Title]         Text     \end{Frame}     Text     \begin{Frame}% no Title         Text     \end{Frame}     Text     \end{document}      I like to use `mdframed` instead of the package and hack to make the picture above because it is more flexible :-)


title: How to use complete width of page in tikz?

text: I have drawn an figure which almost takes 80% of width of the page. So I want it to give full width. If I try it manually, I get warning as overfull \hbox.


title: Mixing enumerate and tabbing, whats wrong here?

text: So I can't seem to figure out whats wrong with my LaTeX file. Do you guys see anything obvious?               \documentclass[11pt]{article}          \newcommand{\df}[1]{\textbf{#1}}          \begin{document}     \section{Midterm 1}         \subsection{Definitions}             \begin{enumerate}                 \begin{tabbing}                 \item \df{Determinism} \= - \= blabhablabhabhalbha                 \item \df{Parsimony} \> - \> alalalalalalala                 \end{tabbing}             \end{enumerate}     \end{document}


title: How to fix the trajectory of Brownian motions which generated by the "rand" function with tikz in beamer frames

text: I draw some Brownian motions in beamer frame with the help of tikz(see Tom's codes). I want to obtain the following effect: > The Brownian motions is truncated by a positive integer. The panoramas of > Brownian motions are showed when the positive integer increases. I try to use some white rectangles for covering Brownian motions with `\onslide` in beamer and draw a line below the rectangle. But the trajectory of Brownian motions changes when the line rises. Because Brownian motions will be drawn again when the overlay is generated by `\onslide`. In every overlay the trajectories are different. Here is my MWE:               \documentclass{beamer}     \useoutertheme{infolines}     \usetheme{Darmstadt}     \usepackage{tikz}     \begin{document}     \begin{frame}{Brownian motions}       \begin{tikzpicture}[scale=0.6]         \draw[help lines] (0,0) grid (15,10);              \draw[red] (0,0)         \foreach \x in {1,2,...,750}           { -- ++(0.02,rand*0.2+0.01) };              \draw[blue] (0,0)         \foreach \x in {1,2,...,750}           { -- ++(0.02,rand*0.2+0.01) };              \draw[green] (0,0)         \foreach \x in {1,2,...,750}           { -- ++(0.02,rand*0.2+0.01) };              \draw[orange] (0,0)         \foreach \x in {1,2,...,750}           { -- ++(0.02,rand*0.2+0.01) };              \foreach \i in {1,2,...,7}           {             \onslide<\i>{             \draw[thick,red] (0,\i+3) -- ++(15,0);             \draw[white,fill=white,very thin] (0,\i+3) rectangle (15,11);             \draw[help lines] (0,\i+3) grid (15,10);             }           }              \draw[thick,->,>=stealth] (0,0) -- (16,0) node[right] {$t$};         \draw[thick,->,>=stealth] (0,0) -- (0,11) node[above] {$Y_t$};       \end{tikzpicture}     \end{frame}     \end{document}       See the following screenshot: ![enter image description here](http://i.stack.imgur.com/tnRZp.png) ![enter image description here](http://i.stack.imgur.com/CsXsf.png) ![enter image description here](http://i.stack.imgur.com/sJUuB.png) So I think if I can fix the trajectories, the effect I want will be obtained easily. I also try to use the following method: > First, draw the trajectories in another document; then use the trajectories > as a single pdf with '\includegraphics'. But I also want to delete the red, orange and green trajectories and leave the blue one alone in the last overlay. Then fixing the trajectories is also important for deleting the trajectories. How can I get the effect talked above? I really appreciate your work.


title: first LaTeX file

text: I installed MiKTeX and ran a test file on TeXworks, but am getting an error message.               \documentclass{article}     \begin{document}     This is some sample text.     \end{document}      I get this error message when attempting to compile to a PDF:               This is pdfTeX, Version 3.1415926-2.4-1.40.13 (MiKTeX 2.9)     entering extended mode     ("C:\Documents and Settings\USER\Desktop\TeX\tex\plain\vertex\test.tex"     LaTeX2e <2011/06/27>     Babel <v3.8m> and hyphenation patterns for english, afrikaans, ancientgreek, ar     abic, armenian, assamese, basque, bengali, bokmal, bulgarian, catalan, coptic,      croatian, czech, danish, dutch, esperanto, estonian, farsi, finnish, french, ga     lician, german, greek, gujarati, hindi, hungarian, icelandic, indonesian, inter     lingua, irish, italian, kannada, kurmanji, latin, latvian, lithuanian, malayala     m, marathi, mongolian, mongolianlmc, monogreek, ngerman, nynorsk, oriya, panjab     i, pinyin, polish, portuguese, romanian, russian, sanskrit, serbian, slovak, sl     ovenian, spanish, swedish, swissgerman, tamil, telugu, turkish, turkmen, ukengl     ish, ukrainian, uppersorbian, usenglishmax, welsh, loaded.     ! Undefined control sequence.     l.1 \topmatter          ?       Now I believe this is happening because my test.tex. file is not in the tex\plain\vertex directory, however, I can't figure out how to make TeXworks automatically look in the directory I want. Also, when I try one of the templates from tex\plain\vertex, I get the same error message as well.


title: Plot and plane and vector

text: I need to plot a plane and a line vertical on the plane in latex with tikz or pgf for a math assignment. How do I do that?


title: TeXLive 2011 ConTeXt problem

text: I was wondering if there were any bugs with ConTeXt on TeXLive 2011. I normally do not use ConTeXt but wanted to play with it.               $ uname -a     OpenBSD oko.bagdala2.net 5.1 GENERIC.MP#188 i386      I have problem processing minimal working example of ConTeXt. The TeXLive 2011 is the version which is shipped with 5.1               $ more test.tex     \setuphead[title][style={\ss\bfd},         before={\begingroup},         after={John Doe, the author\smallskip\currentdate\bigskip\endgroup}]          \starttext          \title{\CONTEXT}          \section{Text}     \CONTEXT\ is a document preparation system for the \TEX\ typesetting     program. It offers programmable desktop publishing features and     extensive          \stoptext      Output               $ texexec test.tex          mtxrun          | kpse fallback with progname 'context' initialized in     0.12 seconds               $ context test.tex          mtxrun          | unknown script 'context.lua' or 'mtx-context.lua'      It looks like a path problem to me. **Edit:**               $ luatools --generate          mtxrun          | unknown script 'base.lua' or 'mtx-base.lua'      However                $ mtxrun --generate      "works" but I am getting the same message when trying to compile minimal working example. However, Joseph Wright's comment is very useful and it seems to imply that ConTeXt problem I encountered is OpenBSD specific. I posted the question at ports.AT.openbsd.org but Edd (our TeXLive maintainer) has not responded yet. I will update the solution.


title: MuPAD (MATLAB symbolic toolbox) export to LaTeX

text: Is it possible to export a entire MuPAD notebook into LaTeX in the same fashion like Mathematica does? I am familiar with MuPAD latex command but it seems (at least on the first glance) that it is less convenient than export command in Mathematica. **Edit** As requested minimal working example of MuPAD notebook.               diff(sin(x), x)       cox(x)     generate::TeX(hold(diff(sin(x),x)))       "\frac{\partial}{\partial x}\sin\!\left(x\right)"     generate::TeX(diff(sin(x),x))       "\cos\!\left(x\right)"      Instead of exporting command and the output separately I would just like to export the entire notebook. P.S. The MuPAD language has a Pascal-like syntax and allows imperative, functional, and object-oriented programming. Its domains and categories are object-oriented classes that allow overriding and overloading methods and operators, inheritance, and generic algorithms.


title: PGF custom shapes and regular polygons

text: TikZ allows regular polygons with specified number of sides for nodes. I'm using PGF though and want similar features and to be able to create my own custom shapes. See percusse's answer for example code: Tikz scale vs pgf scale and http://www.texample.net/tikz/examples/node-shapes/ for the polygons. What I would like is to be able to create a reference shape like `rpoly7` that is simply a regular polygon with 7 sides that uses the TikZ shapes but can be passed to PGF like I do with the other shapes.


title: csquotes and nested citations

text: It looks like the `csquotes` package does not allow nested citations such as               \foreignblockcquote{foreign language}[pre-note]       [post-note with citation \textcite{key2}]       {key1}[punctuation]{quoted text}      The error message is               Package biblatex error: nested citation command. See the biblatex package document for explanation      but I could not find anything in the `csquotes` and `biblatex` user guides. Originally, I was interested in using the `\textcite` command developed by Audrey in biblatex footcite and footnote This question may also be related to Is it possible to make automatic multiple citations with csquotes and biblatex?


title: side caption on beamer poster

text: I like to write caption on the side of the image in a poster using Beamer. I write something like the below. But it doesnt work. It show me a error message:               texify.exe: Windows API error 32: The process cannot access     the file because it is being used by another process.          texify.exe: Data: 1.log      Could any one tell me, how to solve this problem?               \documentclass[final]{beamer}     \usepackage[margincaption]{sidecap}          \begin{document}          \begin{textblock}{}[0,-2.5](33cm,0cm)%     \begin{varblock}[43cm]{}          \begin{SCfigure}       \centering     \includegraphics[height=10cm]{Figure/Panorama_LB.jpg}        \caption{ ... caption text ... }     \end{SCfigure}     \end{varblock}     \end{textblock}          \end{document}


title: Converting footnotemarks to endnotes

text: I am trying to convert all footnotes and footnotemarks in a large document to endnotes. While the footnotes can be readily converted using `\let\footnote=\endnote`, I am not able to convert footnotemarks to endnotemarks. I am using footnotemarks within footnotes to circumvent LaTeX restrictions on nested footnotes. Here is an example showing proper conversion of footnotes, but not footnotemarks, to endnotes: ![enter image description here](http://i.stack.imgur.com/ZJJt2.png)               \documentclass{article}     \usepackage{endnotes}     \let\footnote=\endnote     \begin{document}     Here is a footnote%     \footnote{That contains two nested footnotes\footnotemark\footnotemark.}.%     \footnotetext{The nested footnote is not automatically converted to an endnote.}     \footnotetext{Likewise.}     \theendnotes     \end{document}


title: Changing the TOC style of an Article document-class

text: When typesetting an article documentclass, the sections appear as bold in the table of contents, with no leading dots. I would like to change these to non- bold, and insert some leading dots. I tried the following, but it seems to be ignored. Any ideas?               % change section headers and page numbers to normal instead of bold font     \renewcommand{\cftsecfont}{     \normalfont     }     \renewcommand{\cftsecpagefont}{%     \normalfont     }     % use leader dots with section headers     \renewcommand{\cftsecleader}{\cftdotfill{\cftdotsep}}


title: Change part and section style in latex toc

text: On the TOC, Latex produces part and subsection without dots between the title and the page number. Latex does it, for instance, for subsection. Usually the default setting is nice for me but in this case, I would like to add dots between the title and the page number of each part and section in my TOC. I also want to align the section a bit more on the right side in the TOC. How can I do that?               \documentclass[english]{article}     \usepackage[T1]{fontenc}     \usepackage[latin9]{inputenc}          \makeatletter     \usepackage{lipsum}     \makeatother     \usepackage{babel}     \begin{document}          \tableofcontents{}          \part{Part 1}     \lipsum[1]     \section{Section 1}     \lipsum[1]     \section{Section 2}     \lipsum[1]     \part{Part 1}     \lipsum[1]     \section{Section 1}     \lipsum[1]     \section{Section 2}     \lipsum[1]     \end{document}      ![enter image description here](http://i.stack.imgur.com/4RS2a.png)


title: "align" inside "table" because of table caption - how to do pagebreak?

text: I have a table:               \begin{table}     \begin{align}     \nonumber     b_{1}  & = 0,200                   & \beta_{1}  & = z                           \\     \nonumber     b_{2}  & = 0,022                   & \beta_{2}  & = q                           \\     \nonumber     b_{3}  & = z                       & \beta_{3}  & = 0                           \\     \nonumber     b_{4}  & = 0,024                   & \beta_{4}  & = (3/2)\cdot\pi               \\     \nonumber     b_{5}  & = 0,052                   & \beta_{5}  & = z                           \\     \nonumber     b_{6}  & = 0,067                   & \beta_{6}  & = z                           \\     \nonumber     b_{7}  & = 0,008                   & \beta_{7}  & = z                           \\     \nonumber     b_{8}  & = z                       & \beta_{8}  & = \pi                         \\     \nonumber     b_{9}  & = b_{7}                   & \beta_{9}  & = (3/2)\cdot\pi               \\     \nonumber     b_{10} & = b_{6}-b_{4}             & \beta_{10} & = (3/2)\cdot\pi                    \end{align}     \caption{table 1}     \label{tab 1}     \end{table}      The table continues with more lines. The reason why I formatted it in "align" is because I wanted aligned equal signs and I would have to add $ everywhere because of math. Than I wrapped it in "table" cause I needed table caption. Problem comes with lenght of the table. I tried to use `\allowpagebreaks` but it won't break since it is inside of the table. Then I tried to use longtable but it didn't work with align inside. I also tried to put blank table with caption under "align", but tex sometimes puts the table elsewhere and also in list of tables there should be the number of the page where the table begins I suppose.


title: Autohyphenation of compound Russian words

text: The title says it all... how? There are a lot of compound Russian words that have a hyphen and they need to be hyphenated just like any other word. Polyglossia can do this for German with `"-` and `"=` and whatnot, but nothing like that for Russian. A command to insert a non-hyphenation-suppressing-hyphen would be nice, a command to enable hyphenation in all such words by default would be super helpful.


title: Using tikz diagrams in beamer with minor differences between slides

text: I'd like to highlight different parts of a tikz diagram in beamer slides using something like the `\only` command. I was able to do this at the level of nodes, which is probably fine, but as I have some long node definitions, I was wondering if I could put `\only` inside of the `\node` e.g.               \node [block \only<1>{,fill=blue!50}] (start) {start};      won't work (unsurprisingly). The MWE posted below is an OK solution for my problem, but I'm curious if there is a solution that is more atomic (i.e. works within the `\node` command rather than outside of it. I guess that this is not possible if we are confined to just latex.               \documentclass[compress,red,notes]{beamer}          \usepackage{tikz}          \tikzstyle{line} = [draw, very thick, color=black!50]          \tikzstyle{block} = [rectangle, draw,         text centered, node distance=4em]               \begin{document}          \begin{frame}     \frametitle{An tikz diagram.}     \begin{figure}     \centering     \begin{tikzpicture}[scale=0.5, every node/.style={scale=0.5}]              \only<1>\node [block, fill=blue!50] (start) {start};         \only<2>\node [block] (start) {start};              \node [block, below of=start] (end) {end};              \path [line] (start) -- (end);     \end{tikzpicture}     \end{figure}     \end{frame}          \end{document}      * * * Based on @Kevin C's suggestion to look at @Daniel's answer, I have the following non-working solution:               \documentclass[compress,red,notes]{beamer}          \usepackage{tikz}          \tikzstyle{line} = [draw, very thick, color=black!50]          \tikzstyle{block} = [rectangle, draw,         text centered, node distance=4em]          \tikzset{       invisible/.style={#1{}},       visible on/.style={alt={{color=blue!50}{invisible}}},       alt/.code args={<#1>#2#3}{%         \alt<#1>{\pgfkeysalso{#2}}{\pgfkeysalso{#3}} % \pgfkeysalso doesn't change the path       },     }               \begin{document}          \begin{frame}     \frametitle{An tikz diagram.}     \begin{figure}     \centering     \begin{tikzpicture}[scale=0.5, every node/.style={scale=0.5}]              \node [block, visible on=<2>] (start) {start};              \node [block, below of=start] (end) {end};              \path [line] (start) -- (end);     \end{tikzpicture}     \end{figure}     \end{frame}          \end{document}


title: (Another) problem with url hyphenation in bibliography

text: What I am about to ask has already been asked many times, but nothing seems to work for me so far. Basically I am having troubles in getting urls hyphenated correctly in the bibliography. I modified the command `\UrlBreaks` so that it allows hyphenation everywhere, but this seems to be ignored in the bibliography, while in the rest of the document it does work. Here is a MWE:               % !TEX encoding = UTF-8     % !TEX program = xelatex     \documentclass[12pt,english,a4paper]{article}%     \usepackage[backend=bibtex,defernumbers=true,sorting=nty]{biblatex}%     \usepackage[breaklinks,plainpages=false]{hyperref}%     \def\UrlBreaks{\do\/\do\a\do\b\do\c\do\d\do\e\do\f\do\g\do\h\do\i\do\j\do\k\do\l\do\m\do\n\do\o\do\p\do\q\do\r\do\s\do\t\do\u\do\v\do\w\do\x\do\y\do\z\do\A\do\B\do\C\do\D\do\E\do\F\do\G\do\H\do\I\do\J\do\K\do\L\do\M\do\N\do\O\do\P\do\Q\do\R\do\S\do\T\do\U\do\V\do\W\do\X\do\Y\do\Z\do0\do1\do2\do3\do4\do5\do6\do7\do8\do9\do=\do/\do.\do:}     \addbibresource{Biblio.bib}     \begin{document}     See \cite{citation} for further details or visit \url{http://www.joifewoirjecpwoirjcpewrijcpenwrjcpnewrjicpnwerjincpejricpejripcne.com}.     \printbibliography     \end{document}      and the references are in the file Biblio.bib as follows               @book{citation,     author = {Doe, John},     title = {The Book},     url = {http://www.joifewoirjecpwoirjcpewrijcpenwrjcpnewrjicpnwerjincpejricpejripcne.com}     }      Compiling with `xelatex` (or `pdflatex`) and `bibtex` results in the following output: ![Compiled with xelatex](http://i.stack.imgur.com/SWjJT.png) **A curiosity** (hope it helps in finding the bug): the image above is what comes out compiling with `xelatex`; compiling with `pdflatex` gives the same output, except for the cyan countour line of the link which, ironically, _gets hyphenated_ : ![Compiled with latex](http://i.stack.imgur.com/Ua0tw.png) Using `\sloppy` does something better, but still doesn't make the links hyphenate where I want, i.e. anywhere: ![With sloppy option](http://i.stack.imgur.com/DwPM3.png) As you may imagine, `\raggedright` doesn't solve the issue either. What I am looking for is some code that allows a good hyphenation of the urls in the bibliography with these constraints (I don't know if they are relevant):   1. it has to work with `xelatex` and `bibtex` (`backend=biber` option to `biblatex` doesn't work for me somehow)   2. package `polyglossia` must not be required, rather it has to work with `babel`   3. compatible with package `hyperref`   4. compatible with `book` document class


title: A macro for optimization problems

text: This question is an extension of Using an array environment inside an xparse command. I was advised to make a separate question for the extension. I would like to thank egreg very much for his help. I have two more features that I would like to implement, and I was wondering if I could get just a little more assistance from the community. In particular, I would like to support box constraints and enumerated constraints. Before egreg gave his solution using LaTeX3, my constraint command was a macro with signature `mmmggo`. The first three arguments represented a standard constraint; the fourth and fifth arguments represented the additional information in a box constraint; and the sixth argument represented the enumeration for an enumerated constraint. My attempt to get these features working in shown below (the failed portions are commented out). A couple of notes about my motivation for certain choices: I would like to make the constraints readable in usage, this is why I prefer formatting constraints using the constraint command given below; if none of the constraints are enumerated, I want to prevent the `\qquad` used to set off the enumerations from being printed to preserve the horizontal centering of the problem. I consider the box-constraint issue mostly resolved (I can always just include the additional information for the box constraint in the third argument as shown below). However, I would really like the abilities to   1. have the enumeration be an optional argument, and   2. suppress the `\qquad` used to set off the enumerations when no enumerated constraints are used (to preserve the horizontal centering of the optimization problem).               \documentclass{article}         \usepackage{amsmath}         \usepackage{array}         \usepackage{xparse}              \ExplSyntaxOn             % allocate the variables for an optimization problem             \tl_new:N \l_optprob_operator_tl             \tl_new:N \l_optprob_variable_tl             \tl_new:N \l_optprob_objective_tl             \tl_new:N \l_optprob_constraints_tl                  % define the keys             \keys_define:nn{optprob}             {                 operator   .tl_set:N = \l_optprob_operator_tl,                 variable   .tl_set:N = \l_optprob_variable_tl,                 objective  .tl_set:N = \l_optprob_objective_tl,                 constraint .code:n   = \optprob_add_constraint:nnnnnn #1,                 % constraint .code:n   = \constraint{#1}             }                  \NewDocumentCommand{\optimizationproblem}{m}             {                 % clear the variables                 \tl_clear:N \l_optprob_operator_tl                 \tl_clear:N \l_optprob_variable_tl                 \tl_clear:N \l_optprob_objective_tl                 \tl_clear:N \l_optprob_constraints_tl                      % get the keys                 \keys_set:nn{optprob}{#1}                      % print the optimization problem                 \tl_if_empty:NTF \l_optprob_objective_tl                 {                     % feasibility problem                     \begin{array}[t]{@{}r@{}>{{}}c<{{}}@{}l@{}l}                         \l_optprob_constraints_tl                     \end{array}                 }                 {                     % optimization problem                     \begin{array}{c@{{}\mathrel{:}{}}l}                         \displaystyle\operatorname*{\l_optprob_operator_tl}\sb{\l_optprob_variable_tl} &                             \l_optprob_objective_tl \\[2ex]                         \tl_if_empty:NF \l_optprob_constraints_tl                         {                             % constrained optimization problem                             \textnormal{subject~to} &                                 \begin{array}[t]{@{}r@{}>{{}}c<{{}}@{}l@{}l}                                     \l_optprob_constraints_tl                                 \end{array}                         }                     \end{array}                 }             }                  \NewDocumentCommand{\constraint}{mmmggo}             {                 \IfValueTF{#4}                 {                     \IfValueTF{#6}                     {                         #1 & #2 & #3 #4 #5 & \qquad #6 \\                     }                     {                         #1 & #2 & #3 #4 #5 \\                     }                 }                 {                     \IfValue{#6}                     {                         #1 & #2 & #3 & \qquad #6 \\                     }                     {                         #1 & #2 & #3 \\                     }                 }             }                  % helper function to process the constraints             \cs_new_protected:Npn \optprob_add_constraint:nnnnnn #1 #2 #3 #4             {                 \tl_put_right:Nn \l_optprob_constraints_tl {#1 & #2 & #3 & \qquad #4 \\}             }         \ExplSyntaxOff          \begin{document}          \[         \optimizationproblem         {             operator   = minimize,             variable   = x \in \mathbf{R}^{n},             objective  = c^{T} x,             constraint = {A_{i} x}{=}{b_{i}}{i = 1 , \ldots , m},             % constraint = {A_{i} x}{=}{b_{i}}[i = 1 , \ldots , m],             constraint = {F_{j} x}{\leq}{g_{j}}{j = 1 , \ldots , m},             % constraint = {F_{j} x}{\geq}{g_{j}}[j = 1 , \ldots , m],             constraint = {0}{\leq}{x \leq 1}{},             % constraint = {0}{\leq}{x}{\leq}{1},         }     \]          \end{document}


title: How to change the Find Panel in TexShop?

text: I run a TexShop v3.11 on a Mac OSX 10.8.2. The find panel of TexShop is set to be Ogrekit in Preferences. Then I quit TexShop and reopened it. But, when I use cmd+F in my editing document, the find panel is still the default Apple Find Panel. Could anyone tell me how to fix this?


title: Formatting big matrix and ratios using multi-row entries

text: It is possible to write the denominator or the numerator of a ratio, as well as the entries of a matrix, in multiple rows? This could be helpful in order to format long equations inside a document. * * * Thanks. please excuse me if my question was incomplete. I would like to create matrices or ratios with big entries in two or more that one row. As Werner suggested a solution could be:               \begin{equation}      \begin{array}{cc}        \begin{array}{c}         3 +\\         4 x        \end{array} &        \begin{array}{c}         3 +\\         4 x        \end{array} \\        \begin{array}{c}         3 +\\         4 x        \end{array} &        \begin{array}{c}         3 +\\         4 x        \end{array}      \end{array}     \end{equation}      Now the problem is that it would be important to add more space between the entries in order to distinguish between rows belonging to different entries.


title: how to draw the complex work flow using tikz 2.0

text: I wish to draw a complex work flow using tikz 2.0 because I tried to update the tikz to 2.1, there are many problems. The work work flow is described as follows: ![enter image description here](http://i.stack.imgur.com/Atwkd.jpg) I have tried to draw it by locating the rectangles using coordinator, however it is very hard to make it precise, is there any simpler and better way? Thanks! the code I tried is                   \documentclass{minimal}     \usepackage{tikz}     \usepackage{pgf}     \usetikzlibrary{arrows,automata}      \usetikzlibrary{shapes}     \begin{document}               \begin{tikzpicture}     \draw (-4,-4) rectangle (4,4);     \draw (-0.5,0)  rectangle (-3,-3);     \draw (0.5,0)   rectangle (3,-3);     \draw (-1,0)    rectangle (-2,-1);          \end{tikzpicture}          \end{document}


title: How to correct proper install of sffm.ins into the correct latex directory?

text: I attempted to install the sffms package for texstudio using the latex command, however I just found out that the latex command by itself only installs the new scripts in the correct directory of the sffms unzipped package and not into the the correct global directory for the latex scripts. I need help specifying the correct linux latex command for installing packages in general. I am also having trouble locating the correct linux latex directory which contains all of the script files for latex. I also discovered another problem. When I complied my latex docement inside of the unzipped folder of sffms after I compiled "latex sffms" inside the unzipped sffms folder, I discovered the following errors displayed below. I am not sure if these errors will come after I correctly installed the latexd package in the correct global director.               This is pdfTeX, Version 3.1415926-2.5-1.40.14 (TeX Live 2013/Debian) (format=pdflatex 2013.12.11)  10 AUG 2014 09:55     entering extended mode      restricted \write18 enabled.      %&-line parsing enabled.     **bookonefourscenesample.tex     (./bookonefourscenesample.tex     LaTeX2e <2011/06/27>     Babel <3.9f> and hyphenation patterns for 2 languages loaded.     (./sffms.cls     Document Class: sffms 2003/03/01 v2.1 The SF/F manuscript class     \c@wordcounter=\count79     \wordc=\count80     (/usr/share/texlive/texmf-dist/tex/latex/base/report.cls     Document Class: report 2007/10/19 v1.4h Standard LaTeX document class     (/usr/share/texlive/texmf-dist/tex/latex/base/size12.clo     File: size12.clo 2007/10/19 v1.4h Standard LaTeX file (size option)     )     \c@part=\count81     \c@chapter=\count82     \c@section=\count83     \c@subsection=\count84     \c@subsubsection=\count85     \c@paragraph=\count86     \c@subparagraph=\count87     \c@figure=\count88     \c@table=\count89     \abovecaptionskip=\skip41     \belowcaptionskip=\skip42     \bibindent=\dimen102     )     (/usr/share/texlive/texmf-dist/tex/latex/base/fontenc.sty     Package: fontenc 2005/09/27 v1.99g Standard LaTeX package          (/usr/share/texlive/texmf-dist/tex/latex/base/t1enc.def     File: t1enc.def 2005/09/27 v1.99g Standard LaTeX file     LaTeX Font Info:    Redeclaring font encoding T1 on input line 43.     )     ! Font T1/cmr/m/n/12=ecrm1200 at 12.0pt not loadable: Metric (TFM) file not fou     nd.     <to be read again>                         relax      l.100 \fontencoding\encodingdefault\selectfont          I wasn't able to read the size data for this font,     so I will ignore the font specification.     [Wizards can fix TFM files using TFtoPL/PLtoTF.]     You might try inserting a different font spec;     e.g., type `I\font<same font id>=<substitute font name>'.          ) (./fancyhdr.sty     \headwidth=\dimen103     ) (./ulem.sty     \UL@box=\box26     \UL@hyphenbox=\box27     \UL@skip=\skip43     \UL@hook=\toks14     \UL@pe=\count90     \UL@pixel=\dimen104     \ULC@box=\box28     Package: ulem 2000/05/26     \ULdepth=\dimen105     ) (./setspace.sty     Package: setspace 2000/12/01 6.7 Contributed and Supported LaTeX2e package          Package: `setspace' 6.7 <2000/12/01>     )     \sffms@margin=\skip44     ) (./bookonefourscenesample.aux)     \openout1 = `bookonefourscenesample.aux'.          LaTeX Font Info:    Checking defaults for OML/cmm/m/it on input line 4.     LaTeX Font Info:    ... okay on input line 4.     LaTeX Font Info:    Checking defaults for T1/cmr/m/n on input line 4.     LaTeX Font Info:    ... okay on input line 4.     LaTeX Font Info:    Checking defaults for OT1/cmr/m/n on input line 4.     LaTeX Font Info:    ... okay on input line 4.     LaTeX Font Info:    Checking defaults for OMS/cmsy/m/n on input line 4.     LaTeX Font Info:    ... okay on input line 4.     LaTeX Font Info:    Checking defaults for OMX/cmex/m/n on input line 4.     LaTeX Font Info:    ... okay on input line 4.     LaTeX Font Info:    Checking defaults for U/cmr/m/n on input line 4.     LaTeX Font Info:    ... okay on input line 4.     LaTeX Font Info:    Try loading font information for T1+cmtt on input line 4.          (/usr/share/texlive/texmf-dist/tex/latex/base/t1cmtt.fd     File: t1cmtt.fd 1999/05/25 v2.5h Standard LaTeX font definitions     )     ! Font T1/cmtt/m/n/12=ectt1200 at 12.0pt not loadable: Metric (TFM) file not fo     und.     <to be read again>                         relax      l.4 \begin{document}          I wasn't able to read the size data for this font,     so I will ignore the font specification.     [Wizards can fix TFM files using TFtoPL/PLtoTF.]     You might try inserting a different font spec;     e.g., type `I\font<same font id>=<substitute font name>'.          \sffms@fronttopsavebox=\box29     Missing character: There is no B in font nullfont!     Missing character: There is no e in font nullfont!     Missing character: There is no n in font nullfont!     Missing character: There is no j in font nullfont!     Missing character: There is no a in font nullfont!     Missing character: There is no m in font nullfont!     Missing character: There is no i in font nullfont!     Missing character: There is no n in font nullfont!     Missing character: There is no C in font nullfont!     Missing character: There is no o in font nullfont!     Missing character: There is no m in font nullfont!     Missing character: There is no m in font nullfont!     Missing character: There is no e in font nullfont!     Missing character: There is no a in font nullfont!     Missing character: There is no u in font nullfont!          Underfull \hbox (badness 10000) in paragraph at lines 4--4     []       []               Underfull \hbox (badness 10000) in paragraph at lines 4--4           []          Missing character: There is no 8 in font nullfont!     Missing character: There is no 8 in font nullfont!     Missing character: There is no 5 in font nullfont!     Missing character: There is no w in font nullfont!     ...          ...     Missing character: There is no R in font nullfont!     Missing character: There is no I in font nullfont!     Missing character: There is no E in font nullfont!     Missing character: There is no M in font nullfont!     Missing character: There is no A in font nullfont!     Missing character: There is no N in font nullfont!     Missing character: There is no U in font nullfont!     Missing character: There is no S in font nullfont!     Missing character: There is no / in font nullfont!     Missing character: There is no 3 in font nullfont!      [3] (./bookonefourscenesample.aux) )      Here is how much of TeX's memory you used:      764 strings out of 495031      7951 string characters out of 6181530      60690 words of memory out of 5000000      4032 multiletter control sequences out of 15000+600000      4044 words of font info for 16 fonts, out of 8000000 for 9000      14 hyphenation exceptions out of 8191      28i,11n,45p,2007b,232s stack positions out of 5000i,500n,10000p,200000b,80000s          Output written on bookonefourscenesample.pdf (3 pages, 1148 bytes).     PDF statistics:      14 PDF objects out of 1000 (max. 8388607)      8 compressed objects within 1 object stream      0 named destinations out of 1000 (max. 500000)      1 words of extra memory for PDF output out of 10000 (max. 10000000)


title: To Imply a Dash and not Minus Sign in Math Mode

text: If I am in _Math mode_ , and I want to name a variable, say _max-color_ , here _max_ and _color_ are treated as two different variables and two spaces are placed around the minus sign. Now, what I really meant was a single variable called _max-color_. How to achieve this inside _Math mode_.


title: Is there an easy way to change the column order of a pgfplotstable?

text: I am aware of Rearrange data in pgfplotstable but I was hoping for a kind of one-pass solution that doesn't spread the table over so many commands but is rather self-contained within `\pgfplotstabletypeset`. So here is my not-so-minimal example (sorry but I wanted to keep the thing plausible but readable ...):               \documentclass{standalone}     \usepackage{pgfplotstable}     \usepackage{booktabs}     \usepackage{colortbl}     \usepackage{ragged2e}     \definecolor{cellshade}{rgb}{0.77, 0.82, 0.93}     \definecolor{lightcellshade}{rgb}{0.89, 0.91, 0.97}     \newcolumntype{C}[1]{>{\centering\arraybackslash}m{#1}}     \newcolumntype{R}[1]{>{\RaggedLeft\arraybackslash}m{#1}}     \begin{document}     \pgfplotstabletypeset[         col sep=comma,         column type={C{.24\linewidth}},         columns/Text/.style={reset styles,string type,column type={R{.5\linewidth}}},         columns/Number/.style={reset styles,string type,column type={C{.1\linewidth}}},         every head row/.style={before row={\rowcolor{cellshade}}},         every odd row/.style={before row={\rowcolor{lightcellshade}}},         /pgf/number format/fixed,         /pgf/number format/precision=2,     ]{     Number,Text,Value     1,Lorem ipsum dolor sit amet,0.94178749278214     2,consetetur sadipscing elitr,0.76901823992132     3,sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat,0.65253718698821     4,sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren,0.18096270994776     5,no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet,0.29164374147955     6,consetetur sadipscing elitr,0.39600362303508     7,sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat,0.60941476968239     8,sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren,0.12296095617755     9,no sea takimata sanctus est Lorem ipsum dolor sit amet.,0.70795563336377     }     \end{document}      ![table example](http://i.stack.imgur.com/9V8O7.png) Obviously I screwed up here and need to move the Number column after the Text column, so from [1, 2, 3] to [2, 1, 3]. What's the easiest way of doing that without reading the whole thing as a CSV file into a spreadsheet and then performing column-based operations there?


title: Use small caps in bibliography for institutional authors

text: I'm using biblatex-apa to define the layout of my bibliography. Now I'm citing several (internal) documents from institutions or news websites, which now appear in the document using their abbreviation. I would like to make these abbreviations appear in small caps. Actually, I want all abbreviated institutions to appear in small caps. Is this possible? I now split my bibliography using tags (exported from Zotero), so I assume a tag might also enable the citation to appear as small caps in the text? Anyone knows how to do this? My MWE:               \documentclass[10pt,a4paper,twoside]{book}     \usepackage[american]{babel}     \usepackage{csquotes}     \usepackage[backend=biber, style=apa, date=year, natbib=true, sorting=nyt, sortcites=true]{biblatex}     \DeclareLanguageMapping{american}{american-apa}     \bibliography{Zotero}     \begin{document}     \chapter{Literature review}     This is some text with a double reference \cite{nos_weeralarm_2009, ns_volle_2013}.               \printbibliography[notkeyword=internal]     \printbibliography[title={Internal Documents}, keyword=internal]     \end{document}      And the content of my Zotero.bib:               @online{nos_weeralarm_2009,     title = {Weeralarm en verkeeralarm ingetrokken},     url = {http://nos.nl/l/124074},     titleaddon = {{NOS.nl}},     author = {{NOS}}, %THIS AUTHOR MUST BE PRINTED IN SC     urldate = {2014-02-12},     date = {2009-12-20},     keywords = {gladheid, ijs, ongeluk, openbaar vervoer, schiphol, sneeuw}     }     @report{ns_volle_2013,     location = {Utrecht},     title = {Internal document title}},     institution = {NS},     type = {Internal Document},     author = {{NS}}, % THIS AUTHOR MUST BE PRINTED IN SC     date = {2013},     keywords = {internal}     }


title: How can I have references to several counters in a formatted way with \ref{}?

text: I have two counters in my document, `counterA` and `counterB`. I would like the references `\ref{}` in my document to be printed as `1.a)` or `2.`, etc. where the digit refers to `counterA` and the letter to `counterB`. Is it possible? How can I do it?               \documentclass{article}     \begin{document}          \newcounter{counterA}      \setcounter{counterA}{0}          \newcounter{counterB}     \setcounter{counterB}{0}               \refstepcounter{counterA}     \refstepcounter{counterB}     \label{First_Label}          I get: \ref{Second_Label}. I would like \textbf{2.}\,b)          Vestibulum lectus metus, tincidunt at fermentum non, pellentesque at lorem. Vivamus nisl sem, tempor ac mi et, elementum feugiat justo. Pellentesque tristique consequat molestie.               \bigskip     \refstepcounter{counterA}     \refstepcounter{counterB}     \label{Second_Label}          I get: \ref{First_Label}. I would like \textbf{1.}\,a)          Morbi nec nibh nulla. Cras posuere erat vitae lacus convallis, ut consequat urna dignissim.      \end{document}      ![enter image description here](http://i.stack.imgur.com/lS3TR.png)


title: How to split text into characters

text: I would like to define a function which splits an input text into its constituent letters, so I can process each letter individually (the background to this question is that I would like to put each letter into an individual box, and would like to avoid calling the my boxing function by hand over and over). So how would I go about splitting a text into its letters, so that for each letter, I can call an appropriate subfunction?


title: Output pdf margin VS attributed margin in Latex

text: After a very long search on the net, I post these two questions: The code is:               \documentclass[12pt,twoside]{report}     \usepackage[a4paper,left=3.5cm,right=3cm]{geometry}     \setlength\evensidemargin{-0.23cm}      1) The left margin of the generated pdf (and real sized paper), `d1` (`d1` and `d2` are illustrated in the figure below), is clearly different of the parameter `left` (`left=3.5cm` to get the desired margin `d1=4cm`). Why ? `left` seems to be equal to `d1 - some_parameter`, what is this `some_parameter` ? `d2=3cm`, it seems to be the same as `right`. 2) I have a double side document, what is the right expression of `\setlength\evensidemargin` in order to dynamicaly inverse `d1` and `d2` for even pages? Tentatively, I made a manual assignment, I look for a dynamic expression. ![enter image description here](http://i.stack.imgur.com/Uczoj.png)


title: Hyphenation of words with exotic characters

text: > **Possible Duplicate:**   >  Adequate hyphenation of words already containing a hyphen As a mathematician, I often have to write documents with long words containing embedded mathematical symbols, e.g. λ-representation, -homomorphism, κ-accessible, etc. Neither XeTeX nor LuaTeX is able to correctly hyphenate those words, regardless of whether I'm using `unicode-math` or `mathspec` or directly inputting Unicode characters. Is there a package or an option I can use to automatically hyphenate these words, without having to insert discretionary hyphens by hand everywhere?               \documentclass[12pt,a4paper]{article}          \usepackage{unicode-math}          \setmainfont{TeX Gyre Termes}     \setmathfont{xits-math.otf}          \begin{document}     (ii). Clearly, the constant functions and projection functions admit λ-representations, and the composition of λ-representable functions is certainly λ-representable. The conclusion follows from (i).          (ii). Clearly, the constant functions and projection functions admit $\lambda$-representations, and the composition of $\lambda$-representable functions is certainly $\lambda$-representable. The conclusion follows from (i).     \end{document}


title: Add hyphenation-rule for hyphenated words

text: > **Possible Duplicate:**   >  Adequate hyphenation of words already containing a hyphen Is there any way to define permissible hyphenations for hyphenated words? For example, even if I have hyphenations defined for the words _semi_ and _computable_ , LaTex still fails to break the word _semi-computable_. And if I add to the preamble               \hyphenation{se-mi-com-p-ut-a-ble}      that will only add a rule for _semicomputable_ , not _semi-computable_. EDIT: commentor had the answer Adequate hyphenation of words already containing a hyphen Basically, writing _semi"=computable_ should do the trick .


title: autoref uses wrong name for section, if label occurs after figure

text: I have a document where labels occur inside of sections, i.e., not only at the beginning of a section. If the section contains environments, then `autoref` wronlgy uses for all following labels the name of this environment, but still uses the correct numbering of the section. Moving the label definitions to the top of the section is not an option in my setup. Here is a minimal example:               \documentclass{article}     \usepackage{hyperref}          \begin{document}     \section{ABC}     \section{DEF}     \label{sec:DEFup}          Correctly is section 2: \autoref{sec:DEFup}          \begin{figure}       \centering       XXX       \caption{Three X's}     \end{figure}          \label{sec:DEFdown}     \noindent     Should be section 2, but is Figure 2, which does not even exist:     \autoref{sec:DEFdown}          \end{document}


title: How to avoid copied code with the combination pgfplots/standalone?

text: I have a series of `pgfplots`-based figures that I compile to pdf images using the `standalone` package. I currently have one .tex-file per figure. The problem with this is that since it might just be the data file that changes between the .tex-files, this potentially involves a lot of copied code. Consider the following example:               \documentclass{standalone}     \usepackage{tikz, pgfplots}          \begin{document}     \begin{tikzpicture}          \begin{axis}[     xlabel=$x$,     ylabel=$y$]          \addplot[color=black]     table[x=x, y=y] {table1.txt};     %table[x=x, y=y] {table2.txt};     %table[x=x, y=y] {table3.txt};          \end{axis}          \end{tikzpicture}     \end{document}      The above includes my current solution to the problem stated above: I simply uncomment the appropriate row depending on which .txt-file I want to import, and repeat and recompile until all the pdf files have been generated. Is there a more elegant way of achieving this, preferably automated (so that a bunch of different pdf files are compiled at once)? The closest I've come to a solution is the `multi`-functionality in `standalone`, allowing multiple-page outputs. But I'd prefer output in the form of multiple pdf-images.


title: Sweave documents: saving output for later use

text: I am fairly new to the idea of sweave documents. My document is a .Rnw file containing LaTeX code and R code. Part of my R code is computationally intensive and delays the compilation of my .Rnw file. Once I compile it, it looks all nice and pretty, but if I want to add more information or make some changes, then it takes a while to produce those results. Is there an option, command or some way to tell the compiler to save the output and use it next time the .Rnw file is compiled? If it helps, I am using ESS through emacs on a ubuntu machine.


title: error float.sty line99

text: Well, here is my problem. My friends can compile this document. I can't, and I don't know why. The error is:               File: "C:\Program Files\MikTex\tex\latex\float\float.sty      Type: Error     Line: Line99      message: ! LaTeX Error: Command \float@makebox already defined.      If u can tell me how fix it, I'll be very grateful. I'm using TexMaker and MikTex 2.9.               % PREAMBLE     % Document         \documentclass[spanish,10pt,a4paper,twoside]{article}         \usepackage[top=1in, bottom=1in, left=1in, right=1in, marginpar=57pt]{geometry}         \usepackage[bookmarks=true, bookmarksopen=true, bookmarksopenlevel=1, colorlinks=true, pdfstartview={XYZ null null 1},hidelinks]{hyperref}         %   \usepackage{anysize}          %   \marginsize{3cm}{3cm}{1.5cm}{1.5cm} %izquierda derecha arriba abajo     % Language         \usepackage[latin1]{inputenx}         \usepackage{babel}         \usepackage[T1]{fontenc}         \usepackage{textcomp}     % AMS Packages         \usepackage{amsmath}         \usepackage[adobe-utopia]{mathdesign}          %--------------------------------------------------------------     % Graphics Packages     %--------------------------------------------------------------         \usepackage{graphicx}         \usepackage{subcaption}      %Wrapfig: Insertar imagen dentro del texto,          \usepackage{wrapfig}                   \usepackage{float}     %   \floatstyle{boxed}      %   \restylefloat{figure}                    % SUBFIGURE Y SUBFIG ESTAN DESCATALOGADOS Y NO DEBEN USARSE         %\usepackage{subfigure}     %   \usepackage[lofdepth,lotdepth]{subfig}     %   \usepackage[section]{placeins}          \begin{document}           Hello , fans of Latex               \subsection{Images}          \subsubsection{Matrix of images}               \begin{figure}[H]     \framebox[1\textwidth]{\begin{minipage}[m]{1\textwidth}         \centering         \begin{subfigure}[b]{0.2\textwidth}             \includegraphics[width=\textwidth]{gatico.jpeg}%             \vspace{-1pt}\\%             \includegraphics[width=\textwidth]{gatico.jpeg}%             \vspace{-1pt}         \end{subfigure}%         \begin{subfigure}[b]{0.4\textwidth}             \includegraphics[width=\textwidth]{gatico.jpeg}%             \vspace{-1pt}         \end{subfigure}\\%         \begin{subfigure}[b]{0.6\textwidth}             \includegraphics[width=0.3333\textwidth]{gatico.jpeg}%             \includegraphics[width=0.3333\textwidth]{gatico.jpeg}%             \includegraphics[width=0.3333\textwidth]{gatico.jpeg}%         \end{subfigure}     \end{minipage}}         \caption{Collage}     \end{figure}               \begin{figure}[H]     \framebox[1\textwidth]{\begin{minipage}[m]{1\textwidth}         \centering         \begin{subfigure}[b]{0.3\textwidth}             \includegraphics[width=\textwidth]{gatico.jpeg}%             \caption{}         \end{subfigure}          \begin{subfigure}[b]{0.3\textwidth}             \includegraphics[width=\textwidth]{gatico.jpeg}%             \caption{}         \end{subfigure}     \end{minipage}}         \caption{Matrix of images}     \end{figure}                              \end{document}      * * * I can compile this document https://www.writelatex.com, and this is the result http://dl.dropbox.com/u/29496113/gatico.pdf


title: How to pass \jobname with whitespace to external shell command

text: I need to pass `\jobname` to some external shell command and read back its input using the `\input{|"<shell command>"}` syntax. However `\jobname` may contain whitespaces. So how to quote it for the shell?               % pdflatex --shell-escape "file with spaces"     \documentclass[]{scrartcl}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}          \begin{document}       \input{|"wc \jobname"} % how to quote \jobname here?     \end{document}


title: Does \today use the system clock or take time off of a time server?

text: I would like to know whether `\today` gets time off of a time server or the system clock, and when. Does it get the time when compiling? Upon viewing the document created?


title: Correct spacing when using aligned in cases

text: I have problems getting the spacing right when using aligned in a cases environment. The following illustrates my problem:               \documentclass{article}     \usepackage{amsmath}     \begin{document}          $$     \begin{cases}     1 & \operatorname{\mathbf{if}} a=1 \\     2 & \operatorname{\mathbf{if}} a=2 \\     3 & \operatorname{\mathbf{if}} a=3 \\     4 & \!\begin{aligned}             \operatorname{\mathbf{if}}\, & a=4 \; \wedge \\                                          & a           \end{aligned}     \end{cases}     $$          \end{document}      ![output of example code](http://i.stack.imgur.com/Udma3.png) My questions are   1. Why is there more space between a=1 and a=2 than between a=3 and a=4. How do I fix this?   2. Can it be that lines in the alignment environment are further apart? How do I fix this?   3. Is using `\\!` and `\,` the proper way of achieving correct alignment of `\operatorname{\mathbf{if}}`?


title: Distorted caption in listings

text: The following code produces strange results. Everything looks fine, if I don't include the `subfig` package or don't use the `xleftmargin` parameter. It also works if I use `captionpos=t`. Is there a workaround for this problem? I have to use `subfig`, `xleftmargin` and `captionpos=b`. I am using TexLive 2013 with all updates installed.               \documentclass{article}     \usepackage[english]{babel}          \usepackage{subfig}     \usepackage{blindtext}     \usepackage{listings}          \lstset{        breaklines=true,        captionpos=b,        numbers=left,        xleftmargin=20em     }          \begin{document}          \begin{lstlisting}[caption={information information information information information information information}]     A = B     C = D     \end{lstlisting}     \blindtext          \end{document}      Result: ![enter image description here](http://i.stack.imgur.com/DuRMy.png)


title: summation line for multiple rows

text: Is there a way to add multiple lines of numbers using a "summation line"? Specifically, I want to create something like the below, only better looking.               \documentclass{article}     \usepackage{fontspec,booktabs}     \setmainfont{TeX Gyre Termes}          \begin{document}     \begin{tabular}{ @{} c @{ } c @{ } c @{ } c @{ } c @{ } c @{ } c @{} }     $f(x=1)$ & $=$ & $\sum_{y}f(x=1, y)$ & $=$ & $0,2 + 0,1$ & $=$ & 0,3\\     $f(x=2)$ & $=$ & $\sum_{y}f(x=2, y)$ & $=$ & $0,3 + 0,1$ & $=$ & 0,4\\     $f(x=3)$ & $=$ & $\sum_{y}f(x=3, y)$ & $=$ & $0,1 + 0,2$ & $=$ & 0,3\\                &     &                     &     &             & $+$ &    \\\cmidrule(l){6-7}                &     &                     &     &             &     & 1,0\\     \end{tabular}     \end{document}      I am not interested in doing row or column based mathematical operations. I just want to create a nicer looking summation rule (instead of the one on the lower right part of the table).


title: Set the default path to images directory

text: I have a project written in LaTeX, that has many pictures (about 1000) which I have divided into 4 folders: **letter** , **legal** , **booklt** and **screen** for different purposes. I have a folder called " **images** " containing all the images of the project, and here comes my question: How do I add this folder so that latex finds it by default? I have read the documentation for TeXLive(2011/2012) and http://www.tex.ac.uk/cgi-bin/texfaq2html?label=graphicspath on "environment variable TEXINPUTS". I'm using TeXLive 2012 on Fedora 17; can someone clarify if this possible or is it better to use:               \graphicspath{...}      For now I edit the `.bashrc` file and add:               export TEXINPUTS=~/images//:${TEXINPUTS}      but I'm not sure if that's the best way to do things.


title: How do I install psfig.sty in MacTeX?

text: I just installed MacTeX, and I'm trying to compile a document, but I get the following error:               ! LaTeX Error: File `psfig.sty' not found.      The preamble is as follows:               \documentclass[12pt]{article}     \usepackage{psfig}     \usepackage{subfigure}     \usepackage{rotating}     \usepackage{fullpage}     \usepackage{setspace}       %\singlespacing       %\onehalfspacing       \doublespacing     \usepackage{mathptm}     \usepackage{amsmath}     %\usepackage{cite}     \usepackage{bibentry}     \usepackage{fancyhdr}      I tried updating everything using TeX Live Utility, but that didn't fix it. Where can I find `psfig.sty` and how do I install it?


title: split rectangle

text: i try to draw a split rectangle like this: ![enter image description here](http://i.stack.imgur.com/9liIa.png) And this is my current state :/ Any ideas? ![enter image description here](http://i.stack.imgur.com/H8Twm.png)


title: Making scientific table with AASTex package - is there a better option?

text: I really like the formatting of tables offered by the `AASTex` package. `AASTex` Generator But it is not _quite_ what I need in terms of flexibility. Here is some code for a table I am making. I don't like the way the Table 1 includes a period and is not centered on the first page. I do like the way it looks overall, though. I've tried other formatting and making the table from scratch. I've Googled trying to figure out how to center the first caption and how to get rid of the period - each "solution" leads to another problem. I have a hunch that the best solution will be to create my own table formatting from scratch, but I can't seem to get one to look as nice as this one (at least in terms of fonts and formatting). Here is sample output: ![enter image description here](http://i.stack.imgur.com/hpurZ.png) I appreciate the advice.               %% LaTeX deluxetable generator for the AASTeX package.     %% Written by Greg Schwarz (5/1/2001).          %% Table generated: Sat Jun 23 16:44:36 2012          %% Remove the two lines and the last line if you want     %% want to incorporate this table into another LaTex document.     \documentclass{aastex}     \usepackage{underscore}     %%\usepackage[labelformat=empty]{caption}     \pagestyle{empty}          \begin{document}     %% The values (usually only l,r and c) in the last part of     %% \begin{deluxetable}{} command tell LaTeX how many columns     %% there are and how to align them.          \begin{deluxetable}{rcrcc}          %% Keep a portrait orientation          %% Over-ride the default font size     %% Use 12pt     %%\tabletypesize{\postscriptsize}     \tablewidth{290pt}     \tabletypesize{\scriptsize}     %%\centering     %% Use \tablewidth{?pt} to over-ride the default table width.     %% If you are unhappy with the default look at the end of the     %% *.log file to see what the default was set at before adjusting     %% this value.          %% This is the title of the table.     %%\tablecaption{Table 2}               %% This command over-rides LaTeX's natural table count     %% and replaces it with this number.  LaTeX will increment      %% all other tables after this table based on this number     \tablenum{2}          %% The \tablehead gives provides the column headers.  It     %% is currently set up so that the column labels are on the     %% top line and the units surrounded by ()s are in the      %% bottom line.  You may add more header information by writing     %% another line between these lines. For each column that requries     %% extra information be sure to include a \colhead{text} command     %% and remember to end any extra lines with \\ and include the      %% correct number of &s.     \tablehead{\colhead{Probe} & \colhead{Symbol} & \colhead{Probe} & \colhead{Symbol} & \colhead{Classification} \\      \colhead{} & \colhead{} & \colhead{} & \colhead{}  & \colhead{} }           %% All data must appear between the \startdata and \enddata commands     \startdata          225292_at & COL27A1 & 221605_s_at & PIPOX & 99.0 \\     226421_at & AMMECR1 & 230076_at & PITPNM3 & 99.0 \\     232149_s_at & NSMAF & 226576_at & ARHGAP26 & 99.0 \\     228904_at & HOXB3 & 221605_s_at & PIPOX & 99.0 \\     1568957_x_at & SRGAP2P1 & 206446_s_at & NA & 99.0 \\     203737_s_at & PPRC1 & 206446_s_at & NA & 99.0 \\     205731_s_at & NCOA2 & 221605_s_at & PIPOX & 99.0 \\     225263_at & HS6ST1 & 239132_at & NOS1 & 99.0 \\     239466_at & LOC344595 & 210247_at & SYN2 & 99.0 \\     205150_s_at & TRIL & 221605_s_at & PIPOX & 99.0 \\     227083_at & B3GALTL & 239132_at & NOS1 & 99.0 \\     1554500_a_at & RGS7 & 231916_at & NOS1 & 99.0 \\     1554500_a_at & RGS7 & 239132_at & NOS1 & 99.0 \\     225292_at & COL27A1 & 221605_s_at & PIPOX & 99.0 \\     226421_at & AMMECR1 & 230076_at & PITPNM3 & 99.0 \\     232149_s_at & NSMAF & 226576_at & ARHGAP26 & 99.0 \\     228904_at & HOXB3 & 221605_s_at & PIPOX & 99.0 \\     1568957_x_at & SRGAP2P1 & 206446_s_at & NA & 99.0 \\     203737_s_at & PPRC1 & 206446_s_at & NA & 99.0 \\     205731_s_at & NCOA2 & 221605_s_at & PIPOX & 99.0 \\     225263_at & HS6ST1 & 239132_at & NOS1 & 99.0 \\     239466_at & LOC344595 & 210247_at & SYN2 & 99.0 \\     205150_s_at & TRIL & 221605_s_at & PIPOX & 99.0 \\     227083_at & B3GALTL & 239132_at & NOS1 & 99.0 \\     1554500_a_at & RGS7 & 231916_at & NOS1 & 99.0 \\     1554500_a_at & RGS7 & 239132_at & NOS1 & 99.0 \\     225292_at & COL27A1 & 221605_s_at & PIPOX & 99.0 \\     226421_at & AMMECR1 & 230076_at & PITPNM3 & 99.0 \\     232149_s_at & NSMAF & 226576_at & ARHGAP26 & 99.0 \\     228904_at & HOXB3 & 221605_s_at & PIPOX & 99.0 \\     1568957_x_at & SRGAP2P1 & 206446_s_at & NA & 99.0 \\     203737_s_at & PPRC1 & 206446_s_at & NA & 99.0 \\     205731_s_at & NCOA2 & 221605_s_at & PIPOX & 99.0 \\     225263_at & HS6ST1 & 239132_at & NOS1 & 99.0 \\     239466_at & LOC344595 & 210247_at & SYN2 & 99.0 \\     205150_s_at & TRIL & 221605_s_at & PIPOX & 99.0 \\     227083_at & B3GALTL & 239132_at & NOS1 & 99.0 \\     1554500_a_at & RGS7 & 231916_at & NOS1 & 99.0 \\     1554500_a_at & RGS7 & 239132_at & NOS1 & 99.0 \\     \enddata     %% Include any \tablenotetext{key}{text}, \tablerefs{ref list},     %% or \tablecomments{text} between the \enddata and      %% \end{deluxetable} commands          %% No \tablecomments indicated          %% No \tablerefs indicated          \end{deluxetable}     \end{document}


title: \textheight in LaTeX does not correspond to the size of the frame when using \resizebox

text: I am trying to add a table to my Beamer presentation and is trying to resize it to the frame. To illustrate here is a working example where the table is originally too high to fit into the page. When I use `\textheight` to determine the height of the `\resizebox` it is still way outside the frame and it only comes into the frame whenever I use a fraction of `\textheight` as the command. What I am doing wrong or how is the height of the beamer page determined? Is there another command that will give me the frame size to determine the resizing? Have added a picture to show. The example is just for simplicity and showing that it happens for me even with the simplest setup possible.               \documentclass{beamer}     \mode<presentation> {     \usetheme{Boadilla}      }     \begin{document}          \begin{frame}     \resizebox{\textheight}{!}{%     \begin{tabular}{ccc}     & something & anything \\     Yes & 10 & 20 \\     No & 55 & 4 \\     Yes & 10 & 20 \\     No & 55 & 4 \\     Yes & 10 & 20 \\     No & 55 & 4 \\     Yes & 10 & 20 \\     No & 55 & 4 \\     Yes & 10 & 20 \\     No & 55 & 4 \\     Yes & 10 & 20 \\     No & 55 & 4 \\     \end{tabular}     }%     \end{frame}          \end{document}      ![enter image description here](http://i.stack.imgur.com/WhA08.png)


title: Table formatting

text: I want to create a table like this: ![enter image description here](http://i.stack.imgur.com/fIRQB.png) Here is the code:               \begin{table}[h]     \begin{threeparttable}     \caption{\textit{Sample Selection}}     \centering     \begin{tabular}{lcccccccc}     \toprule\toprule     & (I) & (II) &  (III) & (IV) & (V) & (VI) & (VII) & (VIII) \\     Variables & ADA Model & GCONCERN Model & MEET Model & LOGFEES Model & ADA Model & GCONCERN Model & MEET Model & LOGFEES Model\\\midrule      NLEAD & 0.000& -0.037& 0.0301& 0.006&&&& \\     & (0.15) & (-0.16) & (0.35)  & (0.36) &&&& \\     CLEAD &&&& 0.000 &-0.038 & -0.098 & 0.020  \\     &&&& (0.22) & (-0.21) & (-0.92)  & (1.43) \\     Observations & 75,188 & 6,077 & 11,165 & 24,279 & 23,306 & 3,856 & 5,632 & 16,388\\     Adjusted $R^2$ & 0.045 & 0.149 & 0.026 & 0.694 & 0.041 & 0.155 & 0.027 & 0.711\\     \bottomrule     \end{tabular}      \begin{tablenotes}           \small           \item This is where authors provide additional information about           the data, including whatever notes are needed.         \end{tablenotes}     \end{threeparttable}     \end{table}      I am using booktabs & caption package. Some of the issues which I am facing goes below:   1. Even though I am getting bold Table 7, but it's not capitalized and not on a separate line   2. I have lot of spaces in my table and hence can't see the full table in the output. How do I reduce the spacing between columns?    3. I am getting space between caption and toprule and note and bottomrule. How can redefine the space distance. I know I can use vspace, but I want to redefine the space option. Thanks.


title: Citation on beamer with title

text: I am using `beamer` and writing my bibliographies with `\bibliographystyle{apalike}`. It shows the authors and the year on my citation `\cite{cloudGrid:6}` : `[Ian Foster, 2008]`. I would like to show also the title on my citations. Is it possible on `beame`r? `[Ian Foster, 2008, Cloud Computing and Grid Computing 360-Degree Compared]`


title: Spurious Vertical Space Introduced by multicols (Additional Case)

text: This seems to be a duplicate of Spurious [?] vertical space introduced by multicols, but the solution from there does not seen to work for me. Basically I want the case of using `multicols` to _not_ change the vertical spacing between the intro text and the list. The output on the right is using `multicols`: ![enter image description here](http://i.stack.imgur.com/VnaLo.png) There is also additional space following the `multicols` environment. ## Notes:   * The `minipage` environment was used to illustrate the problem. I don _not_ believe that that is affecting the additional vertical space issue.   * The `tikz` package is used _only_ to highlight the spacing issue. ## Code:               \documentclass{article}      \usepackage{tikz}     \usepackage{enumitem}          \usepackage{multicol}     \raggedcolumns          %\setlength{\multicolbaselineskip}{0pt}% Seems to have no effect               \begin{document}      \begin{minipage}[t]{0.44\linewidth}         The following are examples of numbers:             \begin{itemize}                 \item 0ne,                 \item $\pi$,                 \item $2+3i$,                 and                 \item $0$.             \end{itemize}%         Some text following.     \end{minipage}%     \hfill%-------------------------     \begin{minipage}[t]{0.44\linewidth}         %% http://tex.stackexchange.com/questions/161966/spurious-vertical-space-introduced-by-multicols         %\setlength{\topskip}{\fontcharht\font`B }% Seems to have no effect         The following are examples of numbers:         \begin{multicols}{2}             \begin{itemize}                 \item 0ne,                 \item $\pi$,                 \item $2+3i$,                 \item $0$.                 \item Two,                 \item $e$,                 \item $2-3i$,                 and                 \item $-0$.             \end{itemize}%         \end{multicols}         Some text following.     \end{minipage}%     % Following manually tweaked to show the problem.     \begin{tikzpicture}[overlay, remember picture]         \draw [red]  (-11.5cm,-1.16cm) -- ++(4.8in,0);         \draw [blue] (-11.5cm,-1.86cm) -- ++(4.8in,0);         \draw [orange] (-11.5cm,-3.95cm) -- ++(4.8in,0);     \end{tikzpicture}     \end{document}       * * * ## Results (2014-08-25) Here is the output I get from Frank Mittelbach's MWE (note that the spacing for the text following is not correct): ![enter image description here](http://i.stack.imgur.com/hzHvH.png) ## Output from \listfiles: I just updated _all_ packages from TeXLive2014 prior to running the test. So, is one of my packages out of date, or is there a problem with the TeXLive2014 release:                *File List*      article.cls    2007/10/19 v1.4h Standard LaTeX document class       size10.clo    2007/10/19 v1.4h Standard LaTeX file (size option)         tikz.sty    2013/12/13 v3.0.0 (rcs-revision 1.142)          pgf.sty    2013/12/18 v3.0.0 (rcs-revision 1.14)       pgfrcs.sty    2013/12/20 v3.0.0 (rcs-revision 1.28)     everyshi.sty    2001/05/15 v3.00 EveryShipout Package (MS)       pgfrcs.code.tex      pgfcore.sty    2010/04/11 v3.0.0 (rcs-revision 1.7)     graphicx.sty    2014/04/25 v1.0g Enhanced LaTeX Graphics (DPC,SPQR)       keyval.sty    2014/05/08 v1.15 key=value parser (DPC)     graphics.sty    2009/02/05 v1.0o Standard LaTeX Graphics (DPC,SPQR)         trig.sty    1999/03/16 v1.09 sin cos tan (DPC)     graphics.cfg    2010/04/23 v1.9 graphics configuration of TeX Live       pdftex.def    2011/05/27 v0.06d Graphics/color for pdfTeX     infwarerr.sty    2010/04/08 v1.3 Providing info/warning/error messages (HO)      ltxcmds.sty    2011/11/09 v1.22 LaTeX kernel commands for general use (HO)       pgfsys.sty    2013/11/30 v3.0.0 (rcs-revision 1.47)       pgfsys.code.tex     pgfsyssoftpath.code.tex    2013/09/09  (rcs-revision 1.9)     pgfsysprotocol.code.tex    2006/10/16  (rcs-revision 1.4)       xcolor.sty    2007/01/21 v2.11 LaTeX color extensions (UK)        color.cfg    2007/01/18 v1.5 color configuration of teTeX/TeXLive      pgfcore.code.tex     pgfcomp-version-0-65.sty    2007/07/03 v3.0.0 (rcs-revision 1.7)     pgfcomp-version-1-18.sty    2007/07/23 v3.0.0 (rcs-revision 1.1)       pgffor.sty    2013/12/13 v3.0.0 (rcs-revision 1.25)      pgfkeys.sty          pgfkeys.code.tex      pgfmath.sty          pgfmath.code.tex       pgffor.code.tex         tikz.code.tex     enumitem.sty    2011/09/28 v3.5.2 Customized lists     multicol.sty    2014/04/23 v1.8e multicolumn formatting (FMi)     etoolbox.sty    2011/01/03 v2.1 e-TeX tools for LaTeX         etex.sty    1998/03/26 v2.0 eTeX basic definition package (PEB)     supp-pdf.mkii     pdftexcmds.sty    2011/11/29 v0.20 Utility functions of pdfTeX for LuaTeX (HO)     ifluatex.sty    2010/03/01 v1.3 Provides the ifluatex switch (HO)        ifpdf.sty    2011/01/30 v2.3 Provides the ifpdf switch (HO)     epstopdf-base.sty    2010/02/09 v2.5 Base part for package epstopdf       grfext.sty    2010/08/19 v1.1 Manage graphics extensions (HO)     kvdefinekeys.sty    2011/04/07 v1.3 Define keys (HO)     kvoptions.sty    2011/06/30 v3.11 Key value format for package options (HO)     kvsetkeys.sty    2012/04/25 v1.16 Key value parser (HO)     etexcmds.sty    2011/02/16 v1.5 Avoid name clashes with e-TeX commands (HO)     epstopdf-sys.cfg    2010/07/13 v1.3 Configuration of (r)epstopdf for TeX Live       omscmr.fd    1999/05/25 v2.5h Standard LaTeX font definitions


title: Greek characters in normal and sans serif math mode

text: Here's a simple demonstration program:               \documentclass[12pt]{article}     \usepackage[utf8x]{inputenc}          \DeclareMathVersion{sans}     \SetSymbolFont{letters}{sans}{OT1}{cmss}{m}{sl}          \begin{document}     \[         x +  \alpha \beta     \]     \mathversion{sans}     \[         x  + \alpha \beta     \]     \end{document}        It works fine, but the sans serif math does not have correct greek characters. Adding the following lines almost fixes the problem:               \usepackage[LGR]{fontenc}     \DeclareSymbolFont{grekletters}{LGR}{cmr}{m}{sl}     \DeclareMathSymbol{\alpha}{\mathord}{grekletters}{`a}     \DeclareMathSymbol{\beta}{\mathord}{grekletters}{`b}     %...     \SetSymbolFont{grekletters}{sans}{LGR}{cmss}{m}{n}      But now the Greek characters in math mode are not the original ones. Where are the original ones? There's a similar question: Replacing greek glyphs in math mode. It is about luatex, though. Also, I cannot use the `sansmath` package because it does not support my font encoding.