New answers tagged

1

Sometimes it can be hard to find the duplicated labels, if the error message has no useful info. If you have Python 3 on your system, you can use the following solution (it should also work with Python 2 under small modifications). Paste the code below into a text file and save it as find_duplicates.py: #find_duplicates.py (python code) #inputs: path to ...


0

Apart from the fact that \ifthenelse does not work by expansion \label{\paperPrefix[MyPrefix]{}image} only has one argument (in [] ) so the {} before image is untouched and would form part of the label. I think you want \newcommand{\paperPrefix}[1]{\ifx\activePaper\defaultPaper\else#1_\fi} together with \newcommand\defaultPaper{}%or anything really ...


2

If I've understood what you want correctly, then you would like the following input \section{X} \myplotFF{file={example-image-a},Re=50,DOF=4M, statsName=Drag} to produce the following output The code as you currently have it is a mess. You seem to have multiple modules for one package/class/ and multiple sub-modules for handling the same options/data. ...


4

If I understand correctly than you looking for one of the following results: or Both images are generated by: \documentclass[border=3mm, multi, tikz]{standalone} \begin{document} \begin{tikzpicture}[ vrtx/.style = {circle, draw, fill=gray!30, inner sep=2pt} ] \coordinate (i) at (0,0); \coordinate ...


1

The problem arises because the theorem, corollary, definition, lemma, and proposition environments all share the same counter. The quickest solution I can think of is to (a) add the instruction \usepackage[noabbrev,capitalize]{cleveref} after loading the hyperref package and (b) replace all instances of \autoref with \cref. Aside: I can't help but ...


2

Speaking for myself, I can't help but remark that typesetting the three sub-equations side by side in a row looks plain awful. Either the font size has to be shrunk so drastically that the equations become well-nigh unreadable, or you need to introduce so many line breaks in the subscript terms as to impair readability. Continuing to speak for myself, I'd ...


5

The best solution is: don't do this ... equations become unreadable small: Code: \usepackage[utf8]{inputenc} \usepackage{tabularx} \usepackage[english]{babel} \usepackage{amssymb} \usepackage{empheq, nccmath} \usepackage{showframe} \begin{document} \begin{equation} \label{eq: time} T_{m}^{v+1} - T_{m}^{v} \end{equation} \begin{subequations} ...


1

Note you need \immediate\write and just write the current label \documentclass[10pt]{article} \newwrite\myfile \immediate\openout\myfile=\jobname.keys \makeatletter \newcommand{\answerkey}[1]{\immediate\write\myfile{\@currentlabel #1}} \makeatother \begin{document} \begin{enumerate} \item $1 + 1 = $ \answerkey{ XXXX 2} \begin{enumerate} \item $1 + 2 = $ ...


3

EDITED to actually give an answer. As I explained to Christopher in the comments, the counter for the first level of enumeration is enumi, for the second is enumii, for the third is enumiii in a roman numeral fashion. If the level is not yet invoked, the counter value is 0. Once invoked, it gets stepped to 1 and higher with each new \item. Thus, the \ifnum ...


4

Using the printed number in the \label string is always wrong, it undermines the whole reason for the \label/\ref system that numbering should be automatic. Using a scheme like eq:meaning is useful if you find it useful, but less so if you find thinking of short "meanings" difficult. Personally I'd use \usepackage{showkeys} while drafting so the label ...


4

If your labelled objects exhibit any kind of topical grouping, you can introduce name spaces by using multiple : in the label string: \label{eq:category:meaning}. If those categories are chosen carefully, they tend to scale gracefully even to large (book-sized) documents. However, I would advise against simply using the chapter or section name as the ...


2

\documentclass[12pt]{article} \usepackage{float} \newfloat{video}{tbhp}{lst}%[section] \floatname{video}{Video} \def\Label{\refstepcounter{video}\label} \begin{document} Lorem ipsum (Video \ref{vid:example}). \begin{video} \Label{vid:example} \end{video} \end{document}


2

A working \label needs a \refstepcounter{} to be used before, with the relevant counter, say video. To get this more convenient, use a wrapper, say \genvidlabel with some argument that has the actual label suffix, say example etc. \documentclass[12pt]{article} \newcounter{video} \newcommand{\genvidlabel}[1]{% \refstepcounter{video}\label{vid:#1}% } ...


5

This is 'pretty' easy with tcolorbox and using angular arc option, the background colour etc, the borderline width, inset etc. can be changed at will. The tcbraster environment is a nice way to ensure some layout, i.e. for adhesive label sheets etc. Do not forget to compile twice to get the raster layout working! \documentclass{article} ...


0

Is this what you mean? \documentclass{article} \usepackage{mathtools} \begin{document} \[ \begin{bmatrix} a_{1} \\ a_{2} \\ a_{3} \\ a_{4} \\ \end{bmatrix} \] \begin{equation} \begin{bmatrix} a_{1} \\ a_{2} \\ a_{3} \\ a_{4} \\ \end{bmatrix} \end{equation} \end{document}


3

cleveref is your friend here -- no need to define a \theoremname here -- it's defined by cleveref for many use - cases already. Use \cref for lower case names and \Cref for upper case names. For special names there is no clue for \cleveref to provide the correct name initially, in this case use the setup commands \crefname and \Crefname. The \crefname ...


1

First as a non-float. Then, as a float. EDITED to put caption outside of box. EDITED to introduce new float, InfoBox. \documentclass{article} \usepackage{caption,graphicx,newfloat} \DeclareCaptionType{InfoBox} \begin{document} \fboxsep=8pt\relax \fboxrule=2pt\relax \begin{center} \fbox{\centering \includegraphics[width=2in]{example-image-A}}\par ...



Top 50 recent answers are included