parent_url
stringlengths 41
46
| parent_score
stringlengths 1
4
| parent_body
stringlengths 25
35.5k
| parent_user
stringlengths 37
42
| parent_title
stringlengths 12
150
| accepted
bool 2
classes | body
stringlengths 4
36.7k
| score
stringlengths 1
4
| user
stringlengths 37
42
| answer_id
stringlengths 1
6
| __index_level_0__
int64 0
322k
|
---|---|---|---|---|---|---|---|---|---|---|
https://tex.stackexchange.com/questions/139863 | 1 | I am using TexPad for Mac and I have a central `*.bib` file with my bibliography which is automatically generated using Mendeley. Everything works nicely, but now I want to send my colleague the bibliography (but not my entire `*.bib` file) of our joint work, i.e. the `*.bbl` file and I can't seem to find it anywhere, because TexPad takes care of all the auxiliary files so neatly that they are apparently nowhere to be found - anybody every had that problem?
| https://tex.stackexchange.com/users/38633 | How can I export the *.bbl file after compiling with TexPad and using central *.bib file? | false | Open terminal under the folder, and find the temporary files stored in `.texpadtmp/`.
```
ls .tempadtmp/
cp .tempadtmp/xxx.bbl .
```
| 1 | https://tex.stackexchange.com/users/135232 | 693295 | 321,623 |
https://tex.stackexchange.com/questions/693288 | 2 | I want to write my own library. How could one define a new command equivalent to the following ?
```
\par\noindent\rule[5pt]{\textwidth}{1pt}
```
| https://tex.stackexchange.com/users/302287 | Making new commands | true | The general answer is the one from my comment:
you can wrap most macro sequences into a `newcommand` macro. In your case e.g. `\newcommand{\commandname}{\par\noindent\rule[5pt]{\textwidth}{1pt}}` where you can exchange `\commandname` with your preference.
At the regular user level command names can't contain hyphens, underscores an other special characters.
Of course, there are many possibilities more to define new commands, like `\NewDocumentCommand`, simple `\def` or `expl3` variants.
But for your simple use case `\newcommand` seems best for me.
| 2 | https://tex.stackexchange.com/users/297560 | 693302 | 321,625 |
https://tex.stackexchange.com/questions/693142 | 0 | As expected, biblatex substitutes a dash to the name of the author after the first reference in a list. But it repeats the name if the, say, second reference of the list falls in a new page. I cannot reproduce this in a MWE, sorry, but it happens in my bibliography. Any way to force the dash even after a page break?
```
\RequirePackage{filecontents}
\begin{filecontents}{mybib.bib}
@article{gordon2004,
title = {Continental divide: {{Ernst Cassirer}} and {{Martin Heidegger}} at {{Davos}}, 1929 -- an allegory of intellectual history},
author = {Gordon, Peter E.},
date = {2004},
journaltitle = {Modern Intellectual History},
shortjournal = {Modern Intellectual History},
volume = {1},
number = {2},
pages = {219--248},
publisher = {{Cambridge University Press}},
issn = {1479-2451}
}
@article{gordon2005,
title = {Myth and modernity: {{Cassirer}}'s critique of {{Heidegger}}},
author = {Gordon, Peter E.},
date = {2005},
journaltitle = {New German Critique},
number = {94},
pages = {127--168}
}
\end{filecontents}
\documentclass{book}
\usepackage[style=philosophy-verbose, maxbibnames=2, minbibnames=1, maxsortnames=2, scauthorsbib=false, doi=false, isbn=false,url=false,eprint=false, citepages=suppress]{biblatex}
\bibliography{Mybib.bib}
\begin{document}
\cite{gordon2004} e \cite{gordon2005}.
\printbibliography
\end{document}
```
| https://tex.stackexchange.com/users/254618 | Biblatex / list of references by same authors | true | There should be no erratic behaviour here. With your setting `pagetracker=true,` is active, which tracks all pages separately in onesided mode and tracks double pages (spreads) together in twosided mode (which is active in the MWE thanks to the `book` class). That means that you get no dash if the entry starts at the top of a left page, but you do get a dash at the top of a right page (because it is on the same spread).
If you don't want `biblatex` to take into account pages here, remove the test from the relevant macro.
```
\documentclass[british]{book}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage{csquotes}
\usepackage[
style=philosophy-verbose,
maxbibnames=2, minbibnames=1, maxsortnames=2,
scauthorsbib=false,
doi=false, isbn=false, url=false, eprint=false,
citepages=suppress,
]{biblatex}
\addbibresource{biblatex-examples.bib}
\defbibnote{filler}{A\\B\\C\\D\\E\\F}
\makeatletter
\renewbibmacro*{bbx:dashcheck}[2]{%
\ifboolexpr{
test {\iffieldequals{fullhash}{\bbx@lasthash}}
and
(
not bool {bbx@inset}
or
test {\iffieldequalstr{entrysetcount}{1}}
)
}
{#1}
{#2}}
\makeatother
\begin{document}
\nocite{*}
\printbibliography[prenote=filler]
\end{document}
```
| 0 | https://tex.stackexchange.com/users/35864 | 693303 | 321,626 |
https://tex.stackexchange.com/questions/102277 | 1 | The question [Back-referencing in LaTeX](https://tex.stackexchange.com/questions/37918/back-referencing-in-latex) was marked a duplicate, so I can't post to that thread. Nonetheless, I found the code provided there by Ryan Reich to be a good learning exercise. His solution provided a comma-separated list of back references, without spaces.
I just thought that his approach would be even more useful, if it could be modified to produce not just a string of comma separated numbers, but actual legible text that might be used in a document.
So I tried to improve his solution
| https://tex.stackexchange.com/users/25858 | Making Back-Referencing More Pretty | false | The [`cleveref-usedon`](https://www.ctan.org/pkg/cleveref-usedon) package allows for easy back referencing that uses `cleveref`'s formatting (E.g., "Theorem 1", "Section II").
To use it, I needed to install it as it didn't come as part of my LaTeX installation.
EDIT: As of August 2023, there is a bug in `cleverf-usedon` that causes some back-references to not appear. See [this issue](https://github.com/SvenPistre/cleveref-usedon/issues/4) on GitHub.
| 2 | https://tex.stackexchange.com/users/153678 | 693308 | 321,629 |
https://tex.stackexchange.com/questions/693280 | 1 | What would be the procedure to see the value of a latex variable such as `\baselinestretch` and `\parskip`.
Macros, such as `\baselinestretch): \show\baselinestretch` and for a dimension such as `\parskip): \showthe\parskip` have been suggested to me.
Are the above commands that would be displayed in the latex document ?
| https://tex.stackexchange.com/users/302229 | Displaying values of latex variables | false | It depends on what kind of “variable” you want to show the value of.
Here's a fairly general method; however, primitive parameters should be dealt with case-by-case, so I only provide a method that will work in most cases.
```
\documentclass{article}
\ExplSyntaxOn
\NewDocumentCommand{\showvariable}{sm}
{
\IfBooleanTF { #1 }
{
\exp_args:Nc \agava_showvar:N { #2 }
}
{
\agava_showvar:N #2
}
}
\cs_new:Nn \agava_showvar:N
{
\texttt{\token_to_str:N #1\unskip} ~
\bool_case:n
{
{ \token_if_macro_p:N #1 } { #1 ~ (macro) }
{ \token_if_chardef_p:N #1 } { \int_eval:n { #1 } ~ (chardef) }
{ \token_if_mathchardef_p:N #1 } { \int_eval:n { #1 } ~ (mathchardef) }
{ \token_if_dim_register_p:N #1 } { \dim_eval:n { #1 } ~ (dimension) }
{ \token_if_skip_register_p:N #1 } { \skip_eval:n { #1 } ~ (skip) }
{ \token_if_primitive_p:N #1 } { \the#1 ~ (primitive) }
}
}
\ExplSyntaxOff
\begin{document}
\showvariable{\baselinestretch}
\showvariable{\baselineskip}
\showvariable{\normalbaselineskip}
\showvariable{\textwidth}
\showvariable{\parindent}
\showvariable*{@M}
\linespread{1.2}\selectfont
\showvariable{\baselinestretch}
\end{document}
```
No output in the first case, because the default initial value of `\baselinestretch` is empty.
| 1 | https://tex.stackexchange.com/users/4427 | 693309 | 321,630 |
https://tex.stackexchange.com/questions/693318 | 1 | I am unable to get Table I in between the two lipsum paragraph no matter I tried [h], [!h], and other options. I have no problem w/ {table} but {table\*} seems not respecting the options of positioning?
PS: Pls forgive/ignore the oversized pkg suit which is the current set I'm using. You are very welcome to comment on the pkg set.
```
\documentclass[journal]{IEEEtran}
%\usepackage[retainorgcmds]{IEEEtrantools}
%\usepackage{bibentry}
\usepackage{xcolor,soul,framed} %,caption
\usepackage{verbatim}
\usepackage{cite}
\colorlet{shadecolor}{yellow}
% \usepackage{color,soul}
\usepackage[pdftex]{graphicx}
\graphicspath{{./pdf/}{./photo/}}
\DeclareGraphicsExtensions{.pdf,.jpeg,.png}
\usepackage [english]{babel}
\usepackage [autostyle, english = american]{csquotes}
\MakeOuterQuote{"}
\usepackage[cmex10]{amsmath}
%Mathabx do not work on ScribTex => Removed
%\usepackage{mathabx}
\usepackage{array}
\usepackage{mdwmath}
% \usepackage{mdwtab}
\usepackage{eqparbox}
\usepackage{url}
\usepackage[ruled,vlined]{algorithm2e}
\usepackage{tikz-cd}
\tikzcdset{diagrams={nodes={inner sep=1pt}}}
\usepackage{tikz}
\usetikzlibrary{arrows,
positioning,
overlay-beamer-styles,
shapes.geometric,
decorations.text}
\usepackage{appendix}
\usepackage{adjustbox}
\usetikzlibrary{matrix,arrows,decorations.pathmorphing}
\hyphenation{op-tical net-works semi-conduc-tor}
%\bstctlcite{IEEE:BSTcontrol}
\newtheorem{theorem}{Theorem}
\newtheorem{defn}{Definition}[section]
\DeclareMathOperator*{\argmax}{arg\,max}
% extra packages
\usepackage{caption}
\usepackage{subcaption}
\usepackage{adjustbox}
\def \subFigJustEye{0.4\textwidth}
\def \subFigJust{0.55\textwidth}%this actually defines the justification. The previous name is "subFigJust"
\def \subGraphWidth{0.7\linewidth}
\def \FigWidth{80mm}%80mm is too large. 0. 7\linewidth is recommended.
% \captionsetup[figure]{justification=raggedright,singlelinecheck=false,font=small,labelfont={},name={Fig. },labelsep=period}
% \captionsetup[subfigure]{justification=centering,font=small}
% \usepackage{balance}
% \usepackage{microtype}
\usepackage{listings}
% \usepackage{subfig}
% strike through elements in MA
\usepackage{pst-node}
\usepackage{auto-pst-pdf}
% strike through text
\usepackage{cancel}
%% One column equation
\usepackage{mathtools,amssymb,lipsum}%lipsum: filler text.
\DeclarePairedDelimiter{\ceil}{\lceil}{\rceil}
\usepackage{cuted}
\setlength\stripsep{3pt plus 1pt minus 1pt}
%% Braces over matrix
\usepackage{tikz-cd}
\tikzcdset{diagrams={nodes={inner sep=1pt}}}
% \usepackage{tikz}
\usetikzlibrary{arrows,
positioning,
overlay-beamer-styles,
shapes.geometric,
decorations.text}
% \usepackage{appendix}
\usepackage{caption}
\usepackage{subcaption}
% \usepackage{adjustbox}
% \usepackage[cal=mt,scr=kp]{mathalpha}
% \usepackage{bm}
% \usepackage{stackengine}
\usepackage{cases}
\usepackage{nicematrix}
\DeclareMathOperator{\co}{co}
% restore pdf in dark theme
% \usepackage{xcolor}
% \pagecolor[rgb]{0,0,0} %black
% \color[rgb]{0.5,0.5,0.5} %grey
\usepackage{matlab-prettifier}
\usepackage{float}
%=== TITLE & AUTHORS ====================================================================
\begin{document}
\bstctlcite{IEEEexample:BSTcontrol}
\section{Introduction}
\lipsum[1]
\begin{table*}[!h]
\caption{EH, EW, RHM, RWM, and REM of Ch1, Ch2, and Ch3}
\centering
\begin{tabular}{|l|l|l|l|l|l|l|l|l|l|}
\hline
Channel & EH_{sub1} (mV) & EW_{sub1} (ps) & EH_{sub2} (mV) & EW_{sub2} (ps) & EH_{sub3} (mV) & EW_{sub3} (ps) & RHM & RWM & REM \\ \hline
1 & 61.20 & 31.64 & 64.28 & 32.96 & 57.76 & 31.64 & 0.107 & 0.041 & 0.074 \\ \hline
2 & 62.49 & 32.96 & 64.36 & 32.96 & 58.33 & 32.96 & 0.098 & 0.000 & 0.049 \\ \hline
3 & 22.36 & 23.73 & 66.05 & 29.00 & 28.59 & 26.37 & 1.120 & 0.200 & 0.660 \\ \hline
\end{tabular}
\label{tab:ch123_rem}
\end{table*}
\lipsum[1]
\begin{table*}[h]
\caption{EH, EW, RHM, RWM, and REM of Ch4, and Ch5}
\centering
\begin{tabular}{|l|l|l|l|l|l|l|l|l|l|}
\hline
Channel & EH_{sub1} (mV) & EW_{sub1} (ps) & EH_{sub2} (mV) & EW_{sub2} (ps) & EH_{sub3} (mV) & EW_{sub3} (ps) & RHM & RWM & REM \\ \hline
4 & 404.98 & 35.60 & 466.00 & 36.91 & 462.35 & 35.60 & 0.137 & 0.036 & 0.087 \\ \hline
5 & 359.85 & 35.60 & 371.36 & 35.60 & 369.36 & 35.60 & 0.031 & 0.000 & 0.016 \\ \hline
\end{tabular}
\label{tab:ch45_rem}
\end{table*}
% \begin{table*}[!h]
% \caption{EH, EW, RHM, RWM, and REM of Ch4, and Ch5}
% \centering
% \begin{tabular}{|l|l|l|l|l|l|l|l|l|l|}
% \hline
% Channel & EH_{sub1} (mV) & EW_{sub1} (ps) & EH_{sub2} (mV) & EW_{sub2} (ps) & EH_{sub3} (mV) & EW_{sub3} (ps) & RHM & RWM & REM \\ \hline
% 4 & 404.98 & 35.60 & 466.00 & 36.91 & 462.35 & 35.60 & 0.137 & 0.036 & 0.087 \\ \hline
% 5 & 359.85 & 35.60 & 371.36 & 35.60 & 369.36 & 35.60 & 0.031 & 0.000 & 0.016 \\ \hline
% \end{tabular}
% \label{tab:ch45_rem}
% \end{table*}
% \clearpage
% \section*{References}
% \bibliography{reference}
\bibliographystyle{IEEEtran}
\bibliography{IEEEabrv,Bibliography}
\end{document}
```
| https://tex.stackexchange.com/users/299957 | Cannot make the tables across two columns float | false | No need to employ `table*` environments: With a bit of planning, both "wide" tables can actuallly be made to fit inside a column. Note that quite a bit of horizontal space can be saved by getting rid of the multitudes of vertical rules.
I can't help but remark that many of the packages you load are obsolete and/or harmful. For instance, you should *not* be loading the `caption` and `subcaption` packages when using the `IEEEtran` document class.
```
\documentclass[journal]{IEEEtran}
\usepackage[cmex10]{amsmath}
\usepackage{lipsum,booktabs}
\begin{document}
\section{Introduction}
\lipsum[1][1-4]
\begin{table}[!h]
\setlength\tabcolsep{0pt} % make LaTeX figure out intercol. whitespace amounts
\caption{EH, EW, RHM, RWM, and REM of Ch1, Ch2, and Ch3}
\label{tab:ch123_rem}
\begin{tabular*}{\linewidth}{@{\extracolsep{\fill}}l *{9}{c}}
\toprule
Ch. & EH\textsubscript{sub1} & EW\textsubscript{sub1} & EH\textsubscript{sub2} & EW\textsubscript{sub2} & EH\textsubscript{sub3} & EW\textsubscript{sub3} & RHM & RWM & REM \\
& (mV) & (ps) & (mV) & (ps) & (mV) & (ps) & & & \\
\midrule
1 & 61.20 & 31.64 & 64.28 & 32.96 & 57.76 & 31.64 & 0.107 & 0.041 & 0.074 \\
2 & 62.49 & 32.96 & 64.36 & 32.96 & 58.33 & 32.96 & 0.098 & 0.000 & 0.049 \\
3 & 22.36 & 23.73 & 66.05 & 29.00 & 28.59 & 26.37 & 1.120 & 0.200 & 0.660 \\
\bottomrule
\end{tabular*}
\bigskip
\caption{EH, EW, RHM, RWM, and REM of Ch4, and Ch5}
\label{tab:ch45_rem}
\begin{tabular*}{\linewidth}{@{\extracolsep{\fill}}l *{9}{c}}
\toprule
Ch. & EH\textsubscript{sub1} & EW\textsubscript{sub1} & EH\textsubscript{sub2} & EW\textsubscript{sub2} & EH\textsubscript{sub3} & EW\textsubscript{sub3} & RHM & RWM & REM \\
& (mV) & (ps) & (mV) & (ps) & (mV) & (ps) & & & \\
\midrule
4 & 404.98 & 35.60 & 466.00 & 36.91 & 462.35 & 35.60 & 0.137 & 0.036 & 0.087 \\
5 & 359.85 & 35.60 & 371.36 & 35.60 & 369.36 & 35.60 & 0.031 & 0.000 & 0.016 \\
\bottomrule
\end{tabular*}
\end{table}
\lipsum[2][1-4]
\end{document}
```
| 0 | https://tex.stackexchange.com/users/5001 | 693323 | 321,634 |
https://tex.stackexchange.com/questions/693320 | 0 | I am getting the following problem
```
(/home/hagbard/Opstk/bld/texlive/2022/texmf-dist/tex/latex/amsmath/amsopn.sty)
! LaTeX Error: Command \iint already defined.
Or name \end... illegal, see p.192 of the manual.
l.659 ...ewcommand{\iint}{\DOTSI\MultiIntegral{2}}
```
Here is an MWE
```
\documentclass[a4paper,11pt]{book}
\RequirePackage{wasysym}
\RequirePackage{amsmath}
\begin{document}
\chapter{Introduction}
This chapter's content...
\end{document}
```
`amsmath` conflicts with `wasysym` due to the redefinition of integrals in `wasysym`. Although using `amsmath`, I do not want to miss on the astronomical symbols provided by `wasysym`.
| https://tex.stackexchange.com/users/302314 | Commands already defined | true | Page 2 of the [`wasysym` package documentation](https://texdoc.org/serve/wasysym.pdf/0) will tell you about the `nointegrals` option which avoids this conflict and let's you keep the normal integral signs (which might or might not be what you want):
```
\documentclass[a4paper,11pt]{book}
\RequirePackage[nointegrals]{wasysym}
\RequirePackage{amsmath}
\begin{document}
\chapter{Introduction}
This chapter's content...
\end{document}
```
| 1 | https://tex.stackexchange.com/users/36296 | 693328 | 321,637 |
https://tex.stackexchange.com/questions/171972 | 5 | I'm trying to create a package with three options as follows:
```
\usepackage[swpl]{mypack}
```
`swpl` option provides the environment
```
\begin{myexample}[forced bracketed options]...\end{myexample}
```
available for all xelatex/latex
```
\usepackage[tcb]{mypack}
```
`tcb` option provides the same environment name (with different definition)
```
\begin{myexample}[other forced bracketed options]...\end{myexample}
```
available for latex/xelatex and the third option:
```
\usepackage[pdf,swpl]{mypack} or \usepackage[pdf,tcb]{mypack}
```
provides the same environment name (with other definition) available for (pdf/lua/xe)latex. I'm triying to adapt [related answer](https://tex.stackexchange.com/questions/146308/kvoptions-and-conditional-environment) for this...but I did not succeed. If anyone can help me with a skeleton (using `kvoptions` or `pgfkeys`) I'd appreciate it. I was unable to add `[requiered]` for the `myexample` environment and boolean option for `swpl` and `tcb`.
PD: Using the same environment name because the first option uses `showexpl` and the second option `tcolorbox` for verbatim.
| https://tex.stackexchange.com/users/7832 | Create a package with optional mode and key values | false | This is a rewrite of [Heiko Oberdiek's answer](https://tex.stackexchange.com/a/172011/) using the new option processing facilities in recent versions of LaTeX.
```
\NeedsTeXFormat{LaTeX2e}[2023-01-12]
\ProvidesPackage{mypack}{2023/04/17 My package}
\newif\ifmypack@swpl % swpl: true, tcb: false
\newif\ifmypack@pdf % option pdf
\DeclareKeys [mypack] {%
swpl.if = mypack@swpl,
tcb.ifnot = mypack@swpl,
pdf.if = mypack@pdf,
swpl.usage = load,
tcb.usage = load,
pdf.usage = load,
}
\ProcessKeyOptions [mypack]
```
| 4 | https://tex.stackexchange.com/users/39222 | 693340 | 321,641 |
https://tex.stackexchange.com/questions/693341 | 0 | I would like to split a label in a .dot file across multiple lines in Overleaf.
I reviewed [this](https://stackoverflow.com/questions/10841135/newline-in-node-label-in-dot-graphviz-language) which suggests various forms of \n which doesn't seem to work.
Here's a minimal example:
```
\documentclass{article}
\usepackage{tikz}
\usepackage{dot2texi}
\begin{document}
\begin{tikzpicture}
\begin{dot2tex}[scale=0.9]
\input{depth.dot}
\end{dot2tex}
\end{tikzpicture}
\end{document}
```
Here's the depth.dot file
```
digraph Tree {
node [shape=box, fontname="helvetica"] ;
edge [fontname="helvetica"] ;
0 [label="X[1] <= 1.401\nentropy = 0.858\\\nsamples = 227\nvalue = [47, 4, 176]"] ;
1 [label="X[0] <= 1.02\nentropy = 1.191\nsamples = 43\nvalue = [29, 4, 10]"] ;
0 -> 1 [labeldistance=2.5, labelangle=45, headlabel="True"] ;
}
```
| https://tex.stackexchange.com/users/269765 | Splitting labels on multiple lines not working for .dot file used in an Overleaf document | false | Adding 'pgf' seems to have fixed it (for some reason), enabling the '\n' to cause newlines in the label.
```
...
\begin{dot2tex}[pgf, scale=0.9]
...
```
| 0 | https://tex.stackexchange.com/users/269765 | 693343 | 321,643 |
https://tex.stackexchange.com/questions/693143 | 2 | Is there a way to automatically initialize the second name of an author? In my example: not "Peter Eli" but "Peter E.". (Obviously I know I can just initialize in the bibtex file).
```
\RequirePackage{filecontents}
\begin{filecontents}{mybib.bib}
@article{gordon2004,
title = {Continental divide: {{Ernst Cassirer}} and {{Martin Heidegger}} at {{Davos}}, 1929 -- an allegory of intellectual history},
author = {Gordon, Peter Eli},
date = {2004},
journaltitle = {Modern Intellectual History},
shortjournal = {Modern Intellectual History},
volume = {1},
number = {2},
pages = {219--248},
publisher = {{Cambridge University Press}},
issn = {1479-2451}
}
@article{gordon2005,
title = {Myth and modernity: {{Cassirer}}'s critique of {{Heidegger}}},
author = {Gordon, Peter Eli},
date = {2005},
journaltitle = {New German Critique},
number = {94},
pages = {127--168}
}
\end{filecontents}
\documentclass{book}
\usepackage[style=philosophy-verbose, maxbibnames=2, minbibnames=1, maxsortnames=2, scauthorsbib=false, doi=false, isbn=false,url=false,eprint=false, citepages=suppress]{biblatex}
\bibliography{Mybib.bib}
\begin{document}
\cite{gordon2004} e \cite{gordon2005}.
\printbibliography
\end{document}
```
| https://tex.stackexchange.com/users/254618 | Biblatex / Second author's name initialized | true | biblatex and biber allow you to customise the data model name parts to add whichever name parts you need. So, to implement a real middle name so that you can control its initials properly:
```
% First add middle name as a real name part in the data model
\begin{filecontents}[force]{\jobname.dbx}
\DeclareDatamodelConstant[type=list]{nameparts}{prefix,family,suffix,given,middle}
\end{filecontents}
% Use the biber extended name format to specify the middle name explicltly
\begin{filecontents}[force]{\jobname.bib}
@article{gordon2004,
title = {Continental divide: {{Ernst Cassirer}} and {{Martin Heidegger}} at {{Davos}}, 1929 -- an allegory of intellectual history},
author = {family=Gordon, given=Peter, middle=Eli},
date = {2004},
journaltitle = {Modern Intellectual History},
shortjournal = {Modern Intellectual History},
volume = {1},
number = {2},
pages = {219--248},
publisher = {{Cambridge University Press}},
issn = {1479-2451}
}
@article{gordon2005,
title = {Myth and modernity: {{Cassirer}}'s critique of {{Heidegger}}},
author = {family=Gordon, given=Peter, middle=Eli},
date = {2005},
journaltitle = {New German Critique},
number = {94},
pages = {127--168}
}
\end{filecontents}
\documentclass{book}
% Adding a namepart to the datamodel automatically creates the relevant
% <part>inits package option:
\usepackage[style=philosophy-verbose, maxbibnames=2, minbibnames=1, maxsortnames=2, scauthorsbib=false, doi=false, isbn=false,url=false,eprint=false, citepages=suppress,datamodel=\jobname,middleinits=true]{biblatex}
\addbibresource{\jobname.bib}
% Expand the name printing macro so that middle name is now a separate argument
\newcommand{\mkbibcompletenamegivenmiddlefamily}{\mkbibcompletename}
\newbibmacro*{name:given-middle-family}[5]{%
\usebibmacro{name:delim}{#2#4#1}%
\usebibmacro{name:hook}{#2#4#1}%
\mkbibcompletenamegivenmiddlefamily{%
\ifdefvoid{#2}
{}
{\mkbibnamegiven{#2}\isdot\bibnamedelimd}%
\ifdefvoid{#3}
{}
{\mkbibnamemiddle{#3}\isdot\bibnamedelimd}%
\ifdefvoid{#4}
{}
{\mkbibnameprefix{#4}\isdot
\ifprefchar
{}
{\ifuseprefix{\bibnamedelimc}{\bibnamedelimd}}}%
\mkbibnamefamily{#1}\isdot
\ifdefvoid{#5}{}{\bibnamedelimd\mkbibnamesuffix{#5}\isdot}}}
% Adjust the name format to pass the correct middle name format depending
% on package options. \if<namepart>inits is automatically created when
% adding a name part to the datamodel.
\DeclareNameAlias{author}{given-middle-family}
\DeclareNameFormat{given-middle-family}{%
\ifgiveninits
{\ifmiddleinits
{\usebibmacro{name:given-middle-family}
{\namepartfamily}
{\namepartgiveni}
{\namepartmiddlei}
{\namepartprefix}
{\namepartsuffix}}
{\usebibmacro{name:given-middle-family}
{\namepartfamily}
{\namepartgiveni}
{\namepartmiddle}
{\namepartprefix}
{\namepartsuffix}}
}
{\ifmiddleinits
{\usebibmacro{name:given-middle-family}
{\namepartfamily}
{\namepartgiven}
{\namepartmiddlei}
{\namepartprefix}
{\namepartsuffix}}
{\usebibmacro{name:given-middle-family}
{\namepartfamily}
{\namepartgiven}
{\namepartmiddle}
{\namepartprefix}
{\namepartsuffix}}}%
\usebibmacro{name:andothers}}
\begin{document}
\cite{gordon2004}\\
\cite{gordon2005}
\printbibliography
\end{document}
```
| 2 | https://tex.stackexchange.com/users/1657 | 693345 | 321,645 |
https://tex.stackexchange.com/questions/693352 | 7 | Given the following MWE:
```
\documentclass{minimal}
\ExplSyntaxOn
\int_new:N\g_test_myint_int
\int_set:Nn\g_test_myint_int{2}
\cs_set:Npn\__test_dostuff: {
\lua_now:e{tex.sprint(1)} % Works just fine.
\lua_now:e{tex.sprint(\g_test_myint_int)} % Does not work.
}
\ExplSyntaxOff
\begin{document}
\ExplSyntaxOn
\__test_dostuff:
\ExplSyntaxOff
\end{document}
```
I get an the following error.
```
\directlua]:1: unexpected symbol near '\'.
\lua_now:e #1->\__lua_now:n {#1}
l.17 \__test_dostuff:
```
I know with strings I can use `\luaescapestring{}` to properly escape and send things off to my Lua functions. Is there a way to pass integer variables to Lua functions? While I can call `tonumber(int)` inside my Lua function and get what I need, I feel like there's something simple I'm missing.
Additionally, is there a similar method for passing booleans directly?
| https://tex.stackexchange.com/users/207967 | Passing integer expl3 variables to a Lua function (via \lua_new:e)? | true | `int` are not expandable, you need to expand the value with `\int_use:N`
```
\documentclass{minimal}
\ExplSyntaxOn
\int_new:N\g_test_myint_int
\int_set:Nn\g_test_myint_int{2}
\cs_set:Npn\__test_dostuff: {
\lua_now:e{tex.sprint(1)} % Works just fine.
\lua_now:e{tex.sprint(\int_use:N\g_test_myint_int)} % Does not work.
}
\ExplSyntaxOff
\begin{document}
\ExplSyntaxOn
\__test_dostuff:
\ExplSyntaxOff
\end{document}
```
| 7 | https://tex.stackexchange.com/users/1090 | 693353 | 321,649 |
https://tex.stackexchange.com/questions/693363 | 2 | I want to set my afterskip so that after the title there would be a whitespace seperating the title and the paragraph. I'm using KOMA-script.
Minimum working example:
```
\documentclass{scrbook}
% Specifying titles
\RedeclareSectionCommand[runin=true,afterskip=%\ ?]{subsubsection}
\begin{document}
\subsubsection{Phụ âm đầu}
là bộ phận phụ khởi đầu của một âm tiết trừ đi phần vần và thanh điệu.
\end{document}
```
Edit: the whitespace i'm asking this the space between two letters like this: "**Phụ âm đầu** là bộ phận phụ"
| https://tex.stackexchange.com/users/257308 | How do you make whitespace the afterskip of a runin subsubsection in KOMA script? | true |
The key takes a length you can include stretch and shrink components so that the white space helps justify the line
```
\documentclass{scrbook}
% Specifying titles
\RedeclareSectionCommand[runin=true,afterskip=2cm plus 1cm minus 1cm ]{subsubsection}
\begin{document}
\subsubsection{Phụ âm đầu}
là bộ phận phụ khởi đầu của một âm tiết trừ đi phần vần và thanh điệu.
\end{document}
```
If you want a normal word space use the fontdimens
[What do different \fontdimen<num> mean](https://tex.stackexchange.com/questions/88991/what-do-different-fontdimennum-mean/88993#88993)
```
\documentclass{scrbook}
% Specifying titles
\RedeclareSectionCommand[runin=true,afterskip=\glueexpr
\fontdimen2\font
plus \fontdimen3\font
minus \fontdimen4\font
\relax
]{subsubsection}
\begin{document}
\subsubsection{Phụ âm đầu}
là bộ phận phụ khởi đầu của một âm tiết trừ đi phần vần và thanh điệu.
\end{document}
```
(I do not think `\glueexpr` should be needed, but the option parser gets confused without it)
---
It is horizontal space as you have a run-in heading, with runin false it is vertical space
```
\documentclass{scrbook}
% Specifying titles
\RedeclareSectionCommand[runin=false,afterskip=2cm plus 1cm minus 1cm ]{subsubsection}
\begin{document}
\subsubsection{Phụ âm đầu}
là bộ phận phụ khởi đầu của một âm tiết trừ đi phần vần và thanh điệu.
\end{document}
```
| 3 | https://tex.stackexchange.com/users/1090 | 693365 | 321,652 |
https://tex.stackexchange.com/questions/98188 | 25 | The OTF version of Minion Pro contains several Dingbats glyphs I would like to access. Some of them are not unicode, so I can not just copy the specific unicode character I want to access into my text editor.
In specific, I am looking for the bold looking Moon on page 3 of this document:
<http://www.adobe.com/type/browser/pdfs/1719.pdf>
After searching, I could not figure out how to include a specific character from a font to my document. I found out that I can use the command `\symbol{glyph number}`, but don't see how I should obtain that number.
Thus I ask my question more generally: how can I use a specific glyph from a font using LuaLaTeX?
| https://tex.stackexchange.com/users/1183 | How can I access a specific glyph in LuaLaTeX/Fontspec? | false | The `glyph number` in `\symbol{glyph number}` is the Unicode codepoint.
You can find it for example with [FontForge](https://fontforge.org).
Open the font (e.g., the `.ttf` file) with FontForge.
Right click on the glyph you are interested in, and select "Glyph Info...":
The "Unicode Value" field will give you the Unicode value in hexadecimal:
Now you can use it with `symbol`: `\symbol{"E95E}`.
The `"` before the number indicate that the number is expressed in hexadecimal base.
| 1 | https://tex.stackexchange.com/users/74382 | 693369 | 321,656 |
https://tex.stackexchange.com/questions/45364 | 13 | For example, is it possible to justify the first row of a table differently from the rest? Maybe there is a way to combine two tables to look like one? MWE:
```
\documentclass{article}
\begin{document}
\begin{table}
\begin{tabular}{| c | c | c | c |}
\hline
& \textbf{S1} & \textbf{S2} & \textbf{S3} \\
\hline
\textbf{D1} & 4217 & 5821 & 1102 \\
\textbf{D2} & 3679 & 5089 & 991 \\
\textbf{D3} & 2589 & 3301 & 604 \\
\textbf{D4} & 1418 & 1722 & 294 \\
\hline
\end{tabular}
\end{table}
\end{document}
```
| https://tex.stackexchange.com/users/11060 | Align first row of a table differently then subsequent rows | false | after eleven years ...
* by use of the `makecell` package:
```
\documentclass{article}
\usepackage{booktabs,
makecell} % for `thead` command
\renewcommand\theadfont{}
\begin{document}
\begin{tabular}{lrp{1in}}
\toprule
\thead{A} & \thead{B} & \thead{C}\\
\midrule
left & right & 1 inch\\
l & r & foo\\
\bottomrule
\end{tabular}
\end{document}
```
or
```
\documentclass{article}
\usepackage{booktabs,
makecell}
\renewcommand\theadfont{\normalsize\bfseries}
\begin{document}
\begin{tabular}{lrp{1in}}
\toprule
\thead{A} & \thead{B} & \thead{C}\\
\midrule
left & right & 1 inch\\
l & r & foo\\
\bottomrule
\end{tabular}
\end{document}
```
* today someone my consider novel table package `tabularray`:
```
\documentclass{article}
\usepackage{tabularray}
\UseTblrLibrary{booktabs}
\begin{document}
\begin{tblr}{colspec = {l r Q[l, wd=1in]},
row{1} = {c, font=\bfseries}
}
\toprule
A & B & C \\
\midrule
left & right & 1 inch \\
l & r & foo \\
\bottomrule
\end{tblr}
\end{document}
```
result is the same as in the second example.
| 0 | https://tex.stackexchange.com/users/18189 | 693373 | 321,658 |
https://tex.stackexchange.com/questions/693383 | 6 | I noticed recently that changing the size of parentheses in LaTeX results in a different encoding of the text in the pdf (as determined using the copy/paste functionality in my pdf viewer). For instance, in the command
```
$\sin(x) + \sin\bigl(x\bigr)$
```
the first term is encoded as `s i n ( x )` whereas the second term is encoded as
`s i n <CR> <LF> <U+FFFD> <CR> <LF> x <CR> <LF> <U+FFFD>`. (Here `<CR>` is [carriage return](https://en.wikipedia.org/wiki/Carriage_return), `<LF>` is [line feed](https://en.wikipedia.org/wiki/Newline#Unicode), and `<U+FFFD>` is the unicode symbol for an [unknown, unrecognised, or unrepresentable character](https://en.wikipedia.org/wiki/Specials_(Unicode_block))).
This behavior is undesirable because it makes it impossible to find all instance of "sin(x)" by searching the file. As a mathematician who exclusively reads papers and books on the computer, I find it very important that pdf documents be easily searchable. This is also critical from an accessibility perspective.
**Question**: Is there any easy way to improve the encoding of the pdf file so that (for instance) the two terms above are encoded in the same way?
This site has [a related problem](https://tex.stackexchange.com/questions/119713/making-equations-copyable-in-pdf) that was solved using the `accsupp` package, but in my case that method results in the text string `\sin (x) + \sin \big (x\big )`, which is not so desirable either and is a hassle to make work in the LaTeX file. [Random question: do some visually impaired users prefer that the size of delimiters be recorded, as this output suggests?]
| https://tex.stackexchange.com/users/63544 | Big LaTeX delimiters have a weird encoding in the pdf. How can I avoid this? | true | How glyphs are copied and pasted depends on the ToUnicode values of the font. Setting them is not trivial with the old type1 fonts. The easiest way to improve copy&paste and accessibility of math is to use lualatex and the unicode-math package and so an open-type math font:
```
\documentclass{article}
\usepackage{unicode-math}
\begin{document}
$\sin(x) + \sin\bigl(x\bigr)$
\end{document}
```
The formula is then copied as
sin() + sin()
But you can't search for `sin(x)` as the real text is `sin()` unless your pdf viewer uses some heuristic to map the two x.
With pdflatex and the standard fonts you can try the mmap package:
```
\documentclass{article}
\usepackage{mmap}
\begin{document}
$\sin(x) + \sin\bigl(x\bigr)$
\end{document}
```
This then copies as
```
sin(x) + sin
\bigl(
x
\bigr)
```
| 6 | https://tex.stackexchange.com/users/2388 | 693386 | 321,662 |
https://tex.stackexchange.com/questions/98188 | 25 | The OTF version of Minion Pro contains several Dingbats glyphs I would like to access. Some of them are not unicode, so I can not just copy the specific unicode character I want to access into my text editor.
In specific, I am looking for the bold looking Moon on page 3 of this document:
<http://www.adobe.com/type/browser/pdfs/1719.pdf>
After searching, I could not figure out how to include a specific character from a font to my document. I found out that I can use the command `\symbol{glyph number}`, but don't see how I should obtain that number.
Thus I ask my question more generally: how can I use a specific glyph from a font using LuaLaTeX?
| https://tex.stackexchange.com/users/1183 | How can I access a specific glyph in LuaLaTeX/Fontspec? | false | The [`unicodefonttable`](https://www.ctan.org/pkg/unicodefonttable) package will show every glyph provided by the font and their unicode slots. Scrolling through the table generated by `\displayfonttable{Minion Pro}`, we see
So the moon glyphs are in slots U+E0B9 and U+E0BA, which can be accessed via `\symbol{"E0B9}` and `\symbol{"E0BA}`.
Full example:
```
\documentclass{article}
\usepackage{unicodefonttable}
\setmainfont{Minion Pro}
\begin{document}
\symbol{"E0B9} \symbol{"E0BA}
\displayfonttable{Minion Pro}
\end{document}
```
| 1 | https://tex.stackexchange.com/users/208544 | 693389 | 321,664 |
https://tex.stackexchange.com/questions/693382 | 3 | I would like to define an environment (called `intermittentalign` in the following code) that works like `align` but can work inside of `tabularx` (or inside of `tabular` would be okay too). How might I do this?
```
\documentclass{article}
\usepackage{amsmath}
\usepackage{tabularx}
\begin{document}
% Structure without intermittentalign (for comparison's sake):
\begin{tabularx}{250pt}{rXl}
1. & Math & Words\\
2. & Math & Words\\
3. & Math & Words
\end{tabularx}
% I would like something like this:
% \begin{tabularx}{250pt}{rXl}
% 1. & Math & Words\\
% 2. & \begin{intermittentalign} $ m &= 9/3 $ \end{intermittentalign} & Words\\
% 3. & \begin{intermittentalign} $ &= 3 $ \end{intermittentalign} & Words
% \end{tabularx}
% where the intermittentalign environment recalls the placement of & in previous intermittentalign environments
\end{document}
```
There seem to be similar questions already on StackExchange, but the answers to them don't spell things out enough that I can understand them.
| https://tex.stackexchange.com/users/277990 | Define an environment similar to align such that it can be used in tabularx or tabular | true | As far as I know, this is not possible on the way as you like to have. However, if you insert one more column, you can mimic `align` environment:
```
\documentclass{article}
\usepackage{tabularx}
\begin{document}
\begin{tabularx}{250pt}{r >{\raggedleft$}X<{$} @{\;} >{$\raggedright}X<{$} l}
1. & \multicolumn{2}{c}{Math}
& Words \\
2. & m = & 9/3 & Words \\
3. & = & 3 & Words \\
\end{tabularx}
\end{document}
```
**Addendum:**
if I correctly understand OP comment below (but I'm not sure) he looking for something like this:
**Edit:**
Corrected error error in columns specification. Thanks to @David Carlisle who spotted it.
```
\documentclass{article}
\usepackage{tabularx}
\begin{document}
\begin{tabularx}{250pt}{r >{$}r<{$} @{\;} >{$\raggedright}X<{$} l}
1. & \multicolumn{2}{l}{Math}
& Words \\
2. & m & = 9/3 & Words \\
3. & & = 3 & Words \\
\end{tabularx}
\end{document}
```
| 3 | https://tex.stackexchange.com/users/18189 | 693393 | 321,666 |
https://tex.stackexchange.com/questions/693382 | 3 | I would like to define an environment (called `intermittentalign` in the following code) that works like `align` but can work inside of `tabularx` (or inside of `tabular` would be okay too). How might I do this?
```
\documentclass{article}
\usepackage{amsmath}
\usepackage{tabularx}
\begin{document}
% Structure without intermittentalign (for comparison's sake):
\begin{tabularx}{250pt}{rXl}
1. & Math & Words\\
2. & Math & Words\\
3. & Math & Words
\end{tabularx}
% I would like something like this:
% \begin{tabularx}{250pt}{rXl}
% 1. & Math & Words\\
% 2. & \begin{intermittentalign} $ m &= 9/3 $ \end{intermittentalign} & Words\\
% 3. & \begin{intermittentalign} $ &= 3 $ \end{intermittentalign} & Words
% \end{tabularx}
% where the intermittentalign environment recalls the placement of & in previous intermittentalign environments
\end{document}
```
There seem to be similar questions already on StackExchange, but the answers to them don't spell things out enough that I can understand them.
| https://tex.stackexchange.com/users/277990 | Define an environment similar to align such that it can be used in tabularx or tabular | false | This is not the syntax you desire, but one can use TABstacks to achieve the result.
```
\documentclass{article}
\usepackage{amsmath}
\usepackage{tabularx}
\usepackage{tabstackengine}
\TABstackMath
\strutlongstacks{T}
\begin{document}
% Structure without intermittentalign (for comparison's sake):
\begin{tabularx}{250pt}{rXl}
1. & Math & Words\\
2. & Math & Words\\
3. & Math & more Words\\
4. & Math & final Words
\end{tabularx}
I would like something like this:
\begin{tabularx}{250pt}{rXl}
1. & Math & Words\\
\Longunderstack[r]{2.\\3.} &
\alignLongunderstack{m =& 9/3\\=& 3}&
\Longunderstack[l]{Words\\more Words}\\
4. & Math & final Words
\end{tabularx}
\end{document}
```
| 3 | https://tex.stackexchange.com/users/25858 | 693394 | 321,667 |
https://tex.stackexchange.com/questions/693401 | 3 | In Linux when I want to install packages that are not provided by my distribution's repository, I can manually add entries to `sources.list` and download them.
Are there any such alternative repositories for TeX that provide well-maintained packages unavailable in CTAN? Or is CTAN the one and only go-to for TeX packages?
| https://tex.stackexchange.com/users/302358 | Are there any notable repositories other than CTAN? | false | The TeX community is relatively small, and as far as I know there are no competing sources for packages, other than CTAN, nor would there be any real need for one. Occasionally you will find a package which is only distributed via the author's web site or GitHub repository, but there is no other general source. There are a couple of commercial sites including Overleaf that distribute "templates" that are not on CTAN, but in my experience these are often of dubious quality. This is not to say that everything on CTAN is great either; CTAN does not vet any submissions for quality, but in general, CTAN submissions receive more community visibility given that they get automatically added to TeXLive and MikTeX (assuming they are appropriately licensed).
| 4 | https://tex.stackexchange.com/users/2693 | 693404 | 321,672 |
https://tex.stackexchange.com/questions/693399 | 5 | Why would a simple file like:
```
\documentclass{report}
\usepackage[english,russian]{babel}
\begin{document}
\selectlanguage{english}
Next text in Russian:
\foreignlanguage{russian}{Элементарная теория аналитических}
\end{document}
```
produce completely different results using one or the other engine?
I do understand that they use different sets of fonts, but why that should be the case, specially if the coverage is different under `pdflatex` choice and the others choice?
| https://tex.stackexchange.com/users/224933 | Different results using pdfLaTeX, xeLaTeX or luaLaTeX | false | The whole point with `lualatex` and `xelatex` is they offer many new features not available in `pdflatex`. Even in `pdflatex`, your document is not quite complete, because it misses the declaration of the font encoding (in this case it might work, but not always, and in any case it’s recommended declaring it). So, it’s to be expected that some readjustments will have to be made.
| 3 | https://tex.stackexchange.com/users/5735 | 693405 | 321,673 |
https://tex.stackexchange.com/questions/693406 | 3 | How can I write this expression using LaTeX?
`(2^2)^x+1`
that reads as
in parenthesis
2 raised to 2, close parenthesis, and then raised to a binomial as `x+1`.
I am struggling with this.
| https://tex.stackexchange.com/users/302362 | Number raised to a power enclosed in parenthesis and raised to a power | false | Try (similarly as is suggested in @Gernot comment):
```
\documentclass[margin=3mm]{standalone}
\begin{document}
$\bigl(2^2\bigr)^{x+1}$
\end{document}
```
| 5 | https://tex.stackexchange.com/users/18189 | 693407 | 321,674 |
https://tex.stackexchange.com/questions/693406 | 3 | How can I write this expression using LaTeX?
`(2^2)^x+1`
that reads as
in parenthesis
2 raised to 2, close parenthesis, and then raised to a binomial as `x+1`.
I am struggling with this.
| https://tex.stackexchange.com/users/302362 | Number raised to a power enclosed in parenthesis and raised to a power | false | **TL;DR**
```
(2^{2})^{x+1}
```
**Extended answer**
In the official LaTeX manual you'll not find instances of code similar to `2^2`, but always in the style `2^{2}`; the same for subscripts.
This is not only for uniformity, but mainly to avoid doubts such as yours.
You want to specify what's the superscript and if you type
```
2^x+1
```
TeX will just take `x` as the exponent: what else could it do? It cannot read your mind.
True, a possibility for specifying “two to the power 2, plus one” might have been
```
2^2 +1
```
with a space. However Knuth decided that spaces in math formulas are *always* ignored; moreover, `2^2 +1` would be ambiguous anyway.
So the right syntax is
```
(2^{2})^{x+1}
```
The single token exponent inside the parentheses *can* also be `2^2`, but leave this for when you'll be more experienced.
| 6 | https://tex.stackexchange.com/users/4427 | 693409 | 321,675 |
https://tex.stackexchange.com/questions/693399 | 5 | Why would a simple file like:
```
\documentclass{report}
\usepackage[english,russian]{babel}
\begin{document}
\selectlanguage{english}
Next text in Russian:
\foreignlanguage{russian}{Элементарная теория аналитических}
\end{document}
```
produce completely different results using one or the other engine?
I do understand that they use different sets of fonts, but why that should be the case, specially if the coverage is different under `pdflatex` choice and the others choice?
| https://tex.stackexchange.com/users/224933 | Different results using pdfLaTeX, xeLaTeX or luaLaTeX | false | Output with `pdflatex`:
Output with `xelatex` or `lualatex`:
Hey! Where's the Russian sentence? Here it is:
```
Missing character: There is no Э (U+042D) in font [lmroman10-regular]:mapping=tex-text;!
Missing character: There is no л (U+043B) in font [lmroman10-regular]:mapping=tex-text;!
Missing character: There is no е (U+0435) in font [lmroman10-regular]:mapping=tex-text;!
Missing character: There is no м (U+043C) in font [lmroman10-regular]:mapping=tex-text;!
Missing character: There is no е (U+0435) in font [lmroman10-regular]:mapping=tex-text;!
Missing character: There is no н (U+043D) in font [lmroman10-regular]:mapping=tex-text;!
Missing character: There is no т (U+0442) in font [lmroman10-regular]:mapping=tex-text;!
Missing character: There is no а (U+0430) in font [lmroman10-regular]:mapping=tex-text;!
Missing character: There is no р (U+0440) in font [lmroman10-regular]:mapping=tex-text;!
Missing character: There is no н (U+043D) in font [lmroman10-regular]:mapping=tex-text;!
Missing character: There is no а (U+0430) in font [lmroman10-regular]:mapping=tex-text;!
Missing character: There is no я (U+044F) in font [lmroman10-regular]:mapping=tex-text;!
Missing character: There is no т (U+0442) in font [lmroman10-regular]:mapping=tex-text;!
Missing character: There is no е (U+0435) in font [lmroman10-regular]:mapping=tex-text;!
Missing character: There is no о (U+043E) in font [lmroman10-regular]:mapping=tex-text;!
Missing character: There is no р (U+0440) in font [lmroman10-regular]:mapping=tex-text;!
Missing character: There is no и (U+0438) in font [lmroman10-regular]:mapping=tex-text;!
Missing character: There is no я (U+044F) in font [lmroman10-regular]:mapping=tex-text;!
Missing character: There is no а (U+0430) in font [lmroman10-regular]:mapping=tex-text;!
Missing character: There is no н (U+043D) in font [lmroman10-regular]:mapping=tex-text;!
Missing character: There is no а (U+0430) in font [lmroman10-regular]:mapping=tex-text;!
Missing character: There is no л (U+043B) in font [lmroman10-regular]:mapping=tex-text;!
Missing character: There is no и (U+0438) in font [lmroman10-regular]:mapping=tex-text;!
Missing character: There is no т (U+0442) in font [lmroman10-regular]:mapping=tex-text;!
Missing character: There is no и (U+0438) in font [lmroman10-regular]:mapping=tex-text;!
Missing character: There is no ч (U+0447) in font [lmroman10-regular]:mapping=tex-text;!
Missing character: There is no е (U+0435) in font [lmroman10-regular]:mapping=tex-text;!
Missing character: There is no с (U+0441) in font [lmroman10-regular]:mapping=tex-text;!
Missing character: There is no к (U+043A) in font [lmroman10-regular]:mapping=tex-text;!
Missing character: There is no и (U+0438) in font [lmroman10-regular]:mapping=tex-text;!
Missing character: There is no х (U+0445) in font [lmroman10-regular]:mapping=tex-text;!
```
Is it expected? Yes. The default font with XeLaTeX or LuaLaTeX is Latin Modern, which doesn't cover Cyrillic at all. If you want to typeset Cyrillic text with XeLaTeX or LuaLaTeX you need to use a font that supports it.
For instance, `fontsetup` will choose NewComputer Modern.
```
\documentclass{report}
\usepackage{iftex}
\iftutex
% (Xe|Lua)LaTeX
\usepackage[russian,english]{babel}
\usepackage{fontsetup}
\else
\usepackage[T1,T2A]{fontenc}
\usepackage[russian,english]{babel}
\fi
\begin{document}
Next text in Russian:
\foreignlanguage{russian}{Элементарная теория аналитических}
\end{document}
```
The output with `pdflatex` is the same as before. The output with either XeLaTeX or LuaLaTeX is
Anyway, it's hopeless to make a real document that can be compiled with all engines. Decide which one you want to use and stick with its methods.
| 6 | https://tex.stackexchange.com/users/4427 | 693412 | 321,678 |
https://tex.stackexchange.com/questions/693289 | 2 | How can I make a `ruled dinkus` in `LaTeX`? Meaning three asterisks `***` with a short line (or extending to the paragraph width) on either side of `***`.
| https://tex.stackexchange.com/users/302287 | Making a ruled dinkus | false | This is what I came up with. A command with one optional parameter, the width of the whole dinkus as a proporition of `\linewidth`, where the default is `1` (full width of the line).
```
\documentclass{article}
\usepackage{xhfill}
% https://tex.stackexchange.com/a/233857
\UndeclareTextCommand{\textasteriskcentered}{TS1}
\DeclareTextSymbolDefault{\textasteriskcentered}{OT1}
\DeclareTextCommand{\textasteriskcentered}{OT1}{\raisebox{-.7ex}[1ex][0pt]{*}}
\newcommand{\dinkus}[1][1]{%
\par\vskip0.5\baselineskip%
\noindent%
\hbox to \dimexpr 0.5\linewidth - #1\linewidth / 2\relax{}%
\xrfill[0.5ex]{0.4pt}%
\;\textasteriskcentered\,\textasteriskcentered\,\textasteriskcentered\;%
\xrfill[0.5ex]{0.4pt}%
\hbox to \dimexpr 0.5\linewidth - #1\linewidth / 2\relax{}%
\vskip0.5\baselineskip\par}
\usepackage{lipsum}
\begin{document}
\lipsum[3]
\dinkus[0.2]
\lipsum[4]
\end{document}
```
Despite my earlier comment, using `\centerline` in LaTeX is a bad idea according to various TeX.SE answers.
I used the `xhfill` package for the rules (otherwise difficult to get a raised `\hrulefill`), and [this answer](https://tex.stackexchange.com/a/233857) to get an asterisk that should be centered vertically on the line for different fonts. You may have to play with the height of the rule (hard-coded to `0.5ex`) to get it perfectly aligned with the asterisks for some fonts. MinionPro didn't look perfect, but everything else I tried did. I don't know if you can make it totally foolproof.
| 2 | https://tex.stackexchange.com/users/47128 | 693417 | 321,680 |
https://tex.stackexchange.com/questions/693416 | 1 | I am creating a table with long text separable by comma; I have defined the text width for 2nd column as 11 cm. Now, I want to present the text in the aligned form, but it does not result as expected. I also used tabulary package, but it did not help.
How can I align the text?
```
\begin{table*}
\centering
\caption{Website which spreads Fake News}
\begin{tabular}{ p{1.4 cm} p{11 cm}}
\toprule
\textbf{Language} & \textbf{Domain of Websites} \\ \hline
English & \href{www.rt.com}{rt.com},\href{www.dailyallegiant.com}{dailyallegiant.com},\href{www.naturalnews.com}{naturalnews.com}, \href{www.thegatewaypundit.com{thegatewaypundit.com},\href{www.rt.com{rt.com},\href{www.dailyallegiant.com{dailyallegiant.com},\href{www.naturalnews.com}{naturalnews.com}, \href{www.thegatewaypundit.com}{thegatewaypundit.com},\href{www.rt.com{rt.com},\href{www.thegatewaypundit.com{thegatewaypundit.com},\href{www.rt.com{rt.com},\href{www.thegatewaypundit.com}{thegatewaypundit.com},\href{www.rt.com}{rt.com}
\hline
\end{tabular}
\label{tab:example}
\end{table*}
```
| https://tex.stackexchange.com/users/302374 | How to adjust the text within table | true | I don't know what you want to have, because using your code (with some little improvements) I have this result:
The thing, as David Carlisle says, is that you have spaces only in some places.
The code that I use was this:
```
\documentclass{article}
\usepackage{graphicx} % Required for inserting images
\usepackage{tabulary}
\usepackage{hyperref}
\title{stack tex table}
\author{Table}
\date{\today}
\begin{document}
\maketitle
\begin{table*}[ht]
\centering
\caption{Website which spreads Fake News}
\begin{tabular}{ p{1.4 cm} p{11 cm}}
\textbf{Language} & \textbf{Domain of Websites} \\ \hline
English & \href{www.rt.com}{rt.com}, \href{www.dailyallegiant.com}{dailyallegiant.com}, \href{www.naturalnews.com}{naturalnews.com}, \href{www.thegatewaypundit.com}{thegatewaypundit.com}, \href{www.rt.com}{rt.com}, \href{www.dailyallegiant.com} {dailyallegiant.com}, \href{www.naturalnews.com}{naturalnews.com}, \href{www.thegatewaypundit.com}{thegatewaypundit.com}, \href{www.rt.com}{rt.com}, \href{www.thegatewaypundit.com}{thegatewaypundit.com}, \href{www.rt.com}{rt.com}, \href{www.thegatewaypundit.com}{thegatewaypundit.com}, \href{www.rt.com}{rt.com} \\
\hline
\end{tabular}
\label{tab:example}
\end{table*}
\end{document}
```
| 0 | https://tex.stackexchange.com/users/302207 | 693419 | 321,681 |
https://tex.stackexchange.com/questions/693423 | 3 | I know that using the `xpinyin` package can solve this, but I need to use Lualatex, which is not supported.
At first I used the following code:
```
\documentclass{ctexart}
\usepackage{amsmath}
\newcommand\zhuyin[2]{$\overset{\textrm{#1}}{#2}$}
\begin{document}
\zhuyin{tiān}{天}
\end{document}
```
For general Chinese characters, it works very well.
But now I have some rare characters that need to be annotated, they are in the Unicode Extension B area, which means that the normal font does not include them (I've tried fonts like Source Han Sans): (U+2724D), (U+27246). On my system, it seems that only simsunb.ttf can display them. I'm having trouble changing the font in mathematical mode. I tried the following code and it failed:
```
\documentclass{ctexart}
\usepackage{amsmath}
\newcommand\zhuyin[2]{$\overset{\textrm{#1}}{#2}$}
\newfontfamily{\zyextb}{simsunb.ttf}[NFSSFamily=simsunb]
\DeclareMathAlphabet{\mathzy}{TU}{simsunb}{m}{n}
\begin{document}
%I also tried \zhuyin{jí}{\zyextb }
\zhuyin{jí}{\mathzy }
\end{document}
```
Can you help me?
| https://tex.stackexchange.com/users/301545 | LuaLaTeX - Pinyin over rare Chinese characters | true | You can use `luatexja-ruby` package.
```
\documentclass{ctexart}
\usepackage{luatexja-ruby}
\newcommand\zhuyin[3][]{\ltjruby[{#1}]{#3}{#2}}
\newCJKfontfamily{\esimsun}{simsun.ttc}[NFSSFamily=esimsun,
AlternateFont=
{
{"20000->"2FA1D}{simsunb.ttf},
% {"30000->"323AF}{simsung.ttf}
}]
\begin{document}
\zhuyin{tiān}{天}
\zhuyin{jí}{\esimsun }
{\esimsun\zhuyin{tiān|jí}{天|}}
\end{document}
```
CJK characters are **JAchar**, and their fonts are different from **ALchar**'s. `\newfontfamily` is using to set ALChar's font.
You can use `AlternateFont` key to set alternate fonts, so that this font command can switch to another font automatically.
| 2 | https://tex.stackexchange.com/users/232375 | 693425 | 321,682 |
https://tex.stackexchange.com/questions/693432 | 0 | The chapter prefix option that should display "Chapter 1" on the top of chapter name is not coming. I am a beginner with latex so can not find out what is wrong with my code. Please help.
```
\documentclass[listof=totoc, a4paper, 11pt, oneside, chapterprefix=TRUE, sfdefaults=false]{scrbook}
\usepackage{lipsum} % For generating dummy text
\usepackage[utf8]{inputenc}
%%%%%%%%% Header Footer begin
\usepackage[automark,headsepline,markcase=upper]{scrlayer-scrpage}
\automark[chapter]{chapter}
\clearpairofpagestyles
\setkomafont{pageheadfoot}{}
\setkomafont{pagefoot}{\bfseries\small}
\ohead{\headmark}
\lefoot*{\pagemark{} \rule[-\dp\strutbox]{1pt}{\baselineskip} Page}
\rofoot*{Page \rule[-\dp\strutbox]{1pt}{\baselineskip} \pagemark}
\ifoot*{\ac{MAKAUT, WB}}
\AddToHook{cmd/frontmatter/after}{%
\renewcommand*{\chapterpagestyle}{empty}% instead of plain → manual
\pagestyle{empty}%
}
\AddToHook{cmd/mainmatter/after}{%
\renewcommand*{\chapterpagestyle}{plain}%
\pagestyle{headings}%
}
%%%%%%%%%Header Footer End
\usepackage[pass,a4paper]{geometry}
\usepackage{acronym}
\usepackage[T1]{fontenc}
\usepackage{setspace}
\usepackage[normalem]{ulem} % for underline with normalem option
\usepackage{ragged2e} % For justified text
%\usepackage[none]{./UbuntuFonts/ubuntu}
% Math packages
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{mathtools}
\usepackage{gensymb}
\usepackage{siunitx}
\usepackage{latexsym}
\usepackage{amsthm}
\usepackage{pdfpages}
\usepackage{url}
\usepackage{hyperref}
\usepackage{graphicx}
%\graphicspath{{./images/}}
\usepackage{tabularx}
\usepackage{array}
\usepackage[inline]{asymptote}
\usepackage{eqparbox}
%\usepackage{subfig}
\usepackage[center]{caption}
\usepackage{subcaption}
\usepackage{float}
\usepackage[misc]{ifsym}
\usepackage{csquotes}
\usepackage[section]{placeins}
\usepackage{siunitx}
\usepackage{mdwmath}
\usepackage{mdwtab}
\usepackage{euler}
\usepackage{stmaryrd}
\usepackage{tikz}
\usetikzlibrary{calc}
\usepackage{enumerate}
%\usepackage[backend=bibtex,style=numeric, sorting=none]{biblatex}
%\addbibresource{References.bib}
\usepackage{multicol}% used for the two-column index
\usepackage[bottom]{footmisc}% places footnotes at page bottom
\usepackage{algorithm2e}
%Table packages
\usepackage[figuresright]{rotating}
\setlength{\rotFPtop}{0pt plus 1fil}
\usepackage{booktabs, makecell, multirow, tabularx}
\renewcommand{\theadfont}{\footnotesize\bfseries}
\renewcommand\theadgape{}
\newcolumntype{L}{>{\raggedright\arraybackslash}X}
\newcolumntype{P}[1]{>{\raggedright\arraybackslash}p{#1}}
\newenvironment{calligraphic}{\usefont{T1}{pzc}{m}{it}}{}
% Link setup
\hypersetup{
colorlinks = true, %Colours links instead of ugly boxes
urlcolor = blue, %Colour for external hyperlinks
linkcolor = blue, %Colour of internal links
citecolor = red %Colour of citations
}
%\makeindex
\begin{document}
\frontmatter
%\pagestyle{empty}
\setcounter{page}{1}
%\include{copyright}
%\include{dedication}
%\include{certificate}
\tableofcontents
\listoftables
\listoffigures
%\include{acronyms}
%\include{Acknowledgement}
%\include{Publications Related to Thesis}
%\include{Abstract}
\mainmatter
\pagestyle{scrheadings}
\chapter{Introduction}
\begin{justify}
In recent years, the rapid advancement of the Internet of Things (IoT) has revolutionized various industries, and one of the most promising applications lies in healthcare, especially for the senior citizen population. With the global population aging at an unprecedented rate, the need for innovative solutions to cater to the healthcare needs of elderly individuals has become increasingly pressing. This thesis focuses on the development of IoT-based healthcare systems tailored for senior citizens, addressing critical challenges such as mobility assistance, fall detection, and fall prevention.\\
The first component of this thesis revolves around the creation of a low-cost smart walking assistant, designed to enhance the mobility and independence of seniors. By incorporating sensor-based technology, this system aims to provide real-time support and feedback to elderly individuals during their daily walks, ensuring a safer and more confident experience.\\
The second aspect of this thesis tackles the specific issue of fall detection, which is particularly pertinent for patients with Parkinson's disease. Through the utilization of smartphone-based sensors and intelligent algorithms, a fall detection system will be developed, offering timely alerts to caregivers or medical professionals, ultimately reducing the fear of falling and enhancing the overall quality of life for Parkinson's patients.\\
Lastly, the thesis delves into the creation of an indigenous fall prevention system, specially designed to address the unique needs of senior citizens. This system, characterized by its affordability and ease of use, aims to empower elderly individuals in preventing falls, thereby mitigating potential injuries and improving their sense of security.\\
In conclusion, this thesis endeavors to contribute to the well-being of senior citizens by presenting low-cost, sensor-based, and user-friendly IoT solutions, focusing on enhancing mobility, reducing fear of falling, and preventing falls. These innovations hold great promise in improving the quality of life for lonely seniors, while also providing caregivers and healthcare professionals with valuable tools to monitor and assist this vulnerable population.
\section{Motivation}
\lipsum[3-5]
Write Motivation of the research work
\section{Contribution}
\lipsum[5-6]
Write the thesis contribution
\section{Organization of thesis}
\lipsum[2-3]
Brief description of chapters in the thesis.
\subsection{Chapter 2: Literature Survey}
\lipsum[1-2]
\subsection{Chapter 3:}
\lipsum[1-2]
\subsection{Chapter 4:}
\lipsum[1-2]
\subsection{Chapter 5:}
\lipsum[1-2]
\subsection{Chapter 6:}
\lipsum[1-2]
\subsection{Chapter 7:}
\lipsum[1-2]
\end{justify}
\backmatter
%\printbibliography
\end{document}
```
| https://tex.stackexchange.com/users/218773 | chapterprefix option not working in scrbook class | true | The correct command is `chapterprefix=true`, i.e. lowercase.
| 1 | https://tex.stackexchange.com/users/26614 | 693433 | 321,686 |
https://tex.stackexchange.com/questions/693442 | 4 | I would like to prepare a dcument of class `article` with line numbers. Calling `\linenumbers` numbers the lines within the text as expected. However, I would also like to number the lines of captions within the `\captionof` function. So far, only the last line within the caption is numbered. Calling `\internallinenumbers` before `\captionof` has no effect. (I guess as I do not have a float.)
```
\documentclass[12pt,a4paper]{article}
\usepackage[a4paper,left=2.6cm, right=2.9cm, top=3.5cm, bottom=3.5cm]{geometry}
\renewcommand{\baselinestretch}{2}
\usepackage{lineno}
\usepackage{caption}
\captionsetup{justification=raggedright,singlelinecheck=false}
\begin{document}
\linenumbers
\section{Some section}
Some text
\section{Figure legends}
\captionof{figure}{This should be a figure legend occupying several lines to demonstrate the problem. I will just write some text, don't pay attention to it. It does not make much sense.}
\label{fig:myfig}
\end{document}
```
| https://tex.stackexchange.com/users/290331 | Line numbers in \captionof | true | Instead of using `\internallinenumbers` *before* `\caption` you have to use it *inside* the mandatory `\caption` argument:
```
\documentclass[12pt,a4paper]{article}
\usepackage[a4paper,left=2.6cm, right=2.9cm, top=3.5cm, bottom=3.5cm]{geometry}
\renewcommand{\baselinestretch}{2}
\usepackage{lineno}
\usepackage{caption}
\captionsetup{justification=raggedright,singlelinecheck=false}
\begin{document}
\linenumbers
\section{Some section}
Some text
\section{Figure legends}
\captionof{figure}[{This should be a figure legend occupying several lines to
demonstrate the problem. I will just write some text, don't pay attention to
it. It does not make much sense.}]{\internallinenumbers This should be a figure legend occupying several lines to demonstrate the problem. I will just write some text, don't pay attention to it. It does not make much sense.}
\label{fig:myfig}
\end{document}
```
Repeating the mandatory argument without `\internallinenumbers` as optional argument is needed to avoid writing (the expansion of) `\internallinenumbers` to the `lof` file, which is used to generate the list of figures.
You could even place the `\internallinenumbers` automatically to the mandatory argument only:
```
\documentclass[12pt,a4paper]{article}
\usepackage[a4paper,left=2.6cm, right=2.9cm, top=3.5cm, bottom=3.5cm]{geometry}
\renewcommand{\baselinestretch}{2}
\usepackage{lineno}
\usepackage{caption}
\captionsetup{justification=raggedright,singlelinecheck=false}
\AtBeginDocument{%
\NewCommandCopy\captioncaptionof\captionof
\RenewDocumentCommand\captionof{mO{#3}m}{%
\captioncaptionof{#1}[{#2}]{\internallinenumbers#3}%
}%
}
\begin{document}
\linenumbers
\section{Some section}
Some text
\section{Figure legends}
\captionof{figure}{This should be a figure legend occupying several lines to demonstrate the problem. I will just write some text, don't pay attention to it. It does not make much sense.}
\label{fig:myfig}
\end{document}
```
Note: This suggestion would not work, if you'd put `\captionof` inside a box or minipage. In this case the box/minipage would get it's own line number. So you would have to switch off line numbering before the box and reactivate them after it:
```
\documentclass[12pt,a4paper]{article}
\usepackage[a4paper,left=2.6cm, right=2.9cm, top=3.5cm, bottom=3.5cm]{geometry}
\renewcommand{\baselinestretch}{2}
\usepackage{lineno}
\usepackage{caption}
\captionsetup{justification=raggedright,singlelinecheck=false}
\AtBeginDocument{%
\NewCommandCopy\captioncaptionof\captionof
\RenewDocumentCommand\captionof{mO{#3}m}{%
\captioncaptionof{#1}[{#2}]{\internallinenumbers#3}%
}%
}
\begin{document}
\linenumbers
\section{Some section}
Some text
\section{Figure legends}
\nolinenumbers
\begin{minipage}{\textwidth}
\captionof{figure}{This should be a figure legend occupying several lines to demonstrate the problem. I will just write some text, don't pay attention to it. It does not make much sense.}
\label{fig:myfig}
\end{minipage}
\linenumbers
Text of next paragraph.
\end{document}
```
| 3 | https://tex.stackexchange.com/users/277964 | 693444 | 321,689 |
https://tex.stackexchange.com/questions/688437 | 1 | Building on the nice answer to [this question](https://tex.stackexchange.com/questions/136244/automatically-setting-one-node-after-the-other-in-tikz), I would like to modify the boxes right to the timeline to show a label (instead of the year) that I would like to specify right after the text of each entry, maybe in another {...}. Is this possible? I've seen the [chains manual](https://tikz.dev/library-chains), but this one seems to require quite a bit more knowledge.
```
\documentclass[tikz]{standalone}
\usetikzlibrary{chains}
\makeatletter
\tikzset{west below/.code=\tikz@lib@place@handle@{#1}{north west}{0}{-1}{south west}{1}}
\makeatother
\tikzset{
typnode/.style={anchor=north west, text width=12cm, inner sep=0mm},
data/.style={draw=gray, rectangle, font=\scriptsize, inner sep=0.5mm},
}
\begin{document}
\begin{tikzpicture}[x=1cm, y=-7mm]{
%draw horizontal line
\foreach \xValue in {0,5}
\path (\xValue,0) edge[-latex] ++(0,6.5)
edge[dashed] ++ (down:1);
%%draw years
\foreach \year in {1995,2000}{
\node[left=2pt,anchor=east,xshift=0,font=\scriptsize] at (0,\year - 1995) {$\year$};
}
\foreach \year in {1995,1996,...,2000}{
\draw (-0.1,\year-1995) -- (0.1,\year-1995); \draw (0,\year-1995+.5) -- (0.1,\year-1995+.5);
}
\begin{scope}[start chain=ch1 going west below, node distance=+1em]
\foreach \Year/\Text in {%
1995/{King James VI of Scotland ascends to the English throne, becoming James I of England and uniting the crowns - but not the parliaments - of the two kingdoms},
1995.01/{King James VI of Scotland ascends to the English throne, becoming James I of England and uniting the crowns - but not the parliaments - of the two kingdoms}
}{
\node[typnode, at=(right:3cm), on chain=ch1, alias=Text] {\Text};
\node[data, base left=+2em of Text, alias=Year] {\Year};
\draw (Year.west) -- ++(left:3mm)
-- ([shift=(right:3mm)] 0,{(\Year-1995)/10})
-- (0,{(\Year-1995)/10});
}
\end{scope}
}
\end{tikzpicture}
\end{document}
```
There is also a second vertical line crossing the text that I haven't figured out to remove and when I try to include it in a documentclass[article], I get 1.5 empty pages upfront for a reason I don't understand, but these are secondary questions.
| https://tex.stackexchange.com/users/297368 | How can I label points in a timeline? | true | The second vertical line comes from the second iteration of the first loop.
The linked Q/A used the value `34`, I don't know why OP had that in his original code. Just remove the `5` and/or replace the loop and substitute `0` for `\xValue` (which I did in the code below).
You can just do
```
\node[base right=of Text] {\Label};
```
after you add `\Label` to the loop variables.
**Notes:**
* `1995.01`–`1995.12` will not be recognized as a linear progession through the years. You will need some adjustments to allow real dates.
* If the `\Label` will be multiline it might be higher than the `\Year` node and thus produce bad results when the chain isn't adjusted for that.
Code
----
```
\documentclass[tikz]{standalone}
\usetikzlibrary{chains}
\makeatletter
\tikzset{west below/.code=\tikz@lib@place@handle@{#1}{north west}{0}{-1}{south west}{1}}
\makeatother
\tikzset{
typnode/.style={anchor=north west, text width=12cm, inner sep=0mm},
data/.style={draw=gray, rectangle, font=\scriptsize, inner sep=0.5mm}}
\begin{document}
\begin{tikzpicture}[x=1cm, y=-7mm]
%draw horizontal line
\path (0,0) edge[-latex] ++(0,6.5)
edge[dashed] ++ (down:1);
%%draw years
\foreach \year in {1995,2000}
\node[left=2pt, font=\scriptsize] at (0,\year-1995) {$\year$};
\foreach \year in {1995,1996, ..., 2000}
\draw (-0.1,\year-1995 ) -- (0.1,\year-1995 )
( 0, \year-1995+.5) -- (0.1,\year-1995+.5);
\begin{scope}[start chain=ch1 going west below, node distance=+1em]
\foreach \Year/\Label/\Text in {
1995/{A Label for the first Entry}/{
King James VI of Scotland ascends to the English throne, becoming James I
of England and uniting the crowns -- but not the parliaments --
of the two kingdoms},
1995.01/{A Label for the second Entry}/{
King James VI of Scotland ascends to the English throne, becoming James I
of England and uniting the crowns -- but not the parliaments --
of the two kingdoms}%
}{
\node[typnode, at=(right:3cm), on chain=ch1, alias=Text] {\Text};
\node[data, base left=+2em of Text, alias=Year] {\Year};
\node[base right=of Text]{\Label};
\draw (Year.west) -- ++(left:3mm)
-- ([shift=(right:3mm)] 0,{(\Year-1995)/10})
-- (0,{(\Year-1995)/10});
}
\end{scope}
\end{tikzpicture}
\end{document}
```
Output
------
| 2 | https://tex.stackexchange.com/users/16595 | 693449 | 321,691 |
https://tex.stackexchange.com/questions/693441 | 0 | I am using texshop on a mac (version below) and when compiling the main thesis file it is missing out two of the chapters as it 'cant find the aux file'. Why would this be and how can I resolve the issue? I created the files in the same way and they are formatted the same as the previous results chapters so shouldnt be any different.
It continues to write the main file just excluding these chapters.
Can I force create aux files? Or why would they not be created?
Here is some of the code I get on the console:
```
This is pdfTeX, Version 3.141592653-2.6-1.40.22 (TeX
Live 2021) (preloaded format=pdflatex)
restricted \write18 enabled.
No file Main-pages/ch6-results-ch4.aux.
No file Main-pages/ch7-results-ch5.aux.
```
Please could anyone help - please explain in simplified tex speak with some instructions as I am not the most confident user.
Thank you so much!!
| https://tex.stackexchange.com/users/302402 | .aux files missing or not being created in texshop | false | You have shown no source so it is hard to help, but your main document presumably has
```
\include{Main-pages/ch6-results-ch4}
```
if you add such a line you will always get the warning
```
No file Main-pages/ch6-results-ch4.aux.
```
on the next run of latex, but that run should write `Main-pages/ch6-results-ch4.aux` so on the next run, the warning should go.
If that did not happen then something is preventing the `aux` file.
* TeX might not have write permission to that directory (this would generate an error, which you should show)
* The main document could specify `\includeonly{..}` for some list of files not including `Main-pages/ch6-results-ch4` in which case that chapter will be skipped and no aux file will get written.
* Some other unrelated error caused TeX not to complete properly and write the aux file. In which case you should show the error.
* Some over-aggressive "clean" script from your editor or build pipeline is removing aux files between latex runs. (Don't do that:-)
| 1 | https://tex.stackexchange.com/users/1090 | 693454 | 321,694 |
https://tex.stackexchange.com/questions/121879 | 17 | When I'm generating a List of Figures in my project, all figures are grouped by chapter. I would like to have the whole list without any additional new lines between different chapters.
How it looks like:
```
Figure 1.1
Figure 1.2
Figure 2.1
Figure 3.1
Figure 3.2
```
How it should:
```
Figure 1.1
Figure 1.2
Figure 2.1
Figure 3.1
Figure 3.2
```
I tried to apply the following solutions but failed completely :
* <https://tex.stackexchange.com/a/51074>
* <https://tex.stackexchange.com/a/51880>
My main file:
```
\documentclass[12pt,oneside,titlepage,utf8x]{report}
\usepackage{times,a4wide,multirow,tabularx,graphicx}
\usepackage{psfrag,fancyhdr,longtable}
\usepackage[T1]{fontenc}
\usepackage{float}
\usepackage[utf8]{inputenc}
\usepackage{url}
\usepackage{color}
\usepackage{verbatim}
\usepackage{fancyvrb}
\usepackage{natbib}
\usepackage{relsize}
\usepackage{caption}
\captionsetup[longtable]{belowskip=10pt}
\usepackage[left=4cm,top=2cm,right=3cm,bottom=2.5cm]{geometry}
\renewcommand{\chaptermark}[1]{\markboth{\nouppercase{\thechapter.\ #1}}{}}
\pagestyle{fancy}
\headheight 30pt
\rhead{}
\lfoot{}
\cfoot{\thepage}
\rfoot{}
\setlength{\parindent}{2em}
\setlength{\parskip}{1em}
\linespread{1.3}
\begin{document}
\begin{titlepage}
\maketitle
\end{titlepage}
\tableofcontents
\chapter{First}
\label{sec:First}
\input{chapter1/chapter1}
\chapter{Second}
\label{sec:Second}
\input{chapter2/chapter2}
\chapter{Third}
\label{sec:Third}
\input{chapter3/chapter3}
\relsize{-1}
\listoffigures
\normalsize
\bibliography{praca_mgr}
\bibliographystyle{plain}
\nocite{*}
\end{document}
```
| https://tex.stackexchange.com/users/33021 | Remove spacing between per-chapter figures in LoF | false | Maybe this is the cleanest solution. This solved my problem.
```
\usepackage[figurewithin=none]{caption}
```
| 0 | https://tex.stackexchange.com/users/287423 | 693456 | 321,696 |
https://tex.stackexchange.com/questions/693460 | 0 | I'm preparing a beamer presentation with 16:9 aspect ratio. I want to show 4 figures in one frame as a 2x2 grid. How can I adjust them on one slide. If I reduce figure size, they display far apart from each other.
This is the code that I'm using
```
\begin{figure}
\begin{subfigure}[t]{.4\textwidth}
\centering
\includegraphics[width=\linewidth]{example-image-a}
\caption{\textbf{Schnitt}: $A \cup B$: Element liegt in $A$ \textbf{oder} in $B$.}
\end{subfigure}
\hfill
\begin{subfigure}[t]{.4\textwidth}
\centering
\includegraphics[width=\linewidth]{example-image-b}
\caption{\textbf{Vereinigung}: $A \cap B$: Element liegt in $A$ \textbf{und} in $B$.}
\end{subfigure}
\medskip
\begin{subfigure}[t]{.4\textwidth}
\centering
\includegraphics[width=\linewidth]{example-image-c}
\caption{\textbf{Differenz}: $A \setminus B$: Element liegt in $A$ \textbf{nicht} in $B$. (\textit{A ohne B})}
\end{subfigure}
\hfill
\begin{subfigure}[t]{.4\textwidth}
\centering
\includegraphics[width=\linewidth]{example-image-a}
\caption{\textbf{Symmetrische Differenz}: $A \Delta B$: Element liegt \textbf{entweder} in $A$ oder in $B$.}
\end{subfigure}
\end{figure}
```
| https://tex.stackexchange.com/users/302415 | 2 by 2 Grid of Subfigures on Beamer Latex | false |
>
> If I reduce figure size, they display far apart from each other.
>
>
>
You can avoid this by using a fixed length as distance instead of `\hfill`. This way the distance between the image will remain the same when you change their size.
You could for example use `\hspace{1cm}`, `\qquad` or similar macros:
```
\documentclass[aspectratio=169]{beamer}
\usepackage{subcaption}
\begin{document}
\begin{frame}
\begin{figure}
\begin{subfigure}[t]{.4\textwidth}
\centering
\includegraphics[width=.7\linewidth]{example-image-a}
\caption{\textbf{Schnitt}: $A \cup B$: Element liegt in $A$ \textbf{oder} in $B$.}
\end{subfigure}
\qquad
\begin{subfigure}[t]{.4\textwidth}
\centering
\includegraphics[width=.7\linewidth]{example-image-b}
\caption{\textbf{Vereinigung}: $A \cap B$: Element liegt in $A$ \textbf{und} in $B$.}
\end{subfigure}
\medskip
\begin{subfigure}[t]{.4\textwidth}
\centering
\includegraphics[width=.7\linewidth]{example-image-c}
\caption{\textbf{Differenz}: $A \setminus B$: Element liegt in $A$ \textbf{nicht} in $B$. (\textit{A ohne B})}
\end{subfigure}
\qquad
\begin{subfigure}[t]{.4\textwidth}
\centering
\includegraphics[width=.7\linewidth]{example-image-a}
\caption{\textbf{Symmetrische Differenz}: $A \Delta B$: Element liegt \textbf{entweder} in $A$ oder in $B$.}
\end{subfigure}
\end{figure}
\end{frame}
\end{document}
```
| 0 | https://tex.stackexchange.com/users/36296 | 693461 | 321,699 |
https://tex.stackexchange.com/questions/498034 | 3 | I am submitting an article in Arxiv.
I need to write abstract for that.
I have written in latex but when I copy the same in abstract there is a problem with citation. I have uploaded .bbl file in Arxiv. When I compile, its is not taking \cite{some name} where “some name” is some label in .bbl file.
I have written `\<https://arxiv.org/abs/math/0605694>` but it is not compiling correctly.
Can some one suggest how to cite a webpage correctly in Arxiv abstract?
| https://tex.stackexchange.com/users/165931 | Latex in Arxiv abstract | false | arXiv-ids entered into the metadata abstract are automatically linked into a clickable link at the time of announcement. Currently the submission system does not convert links into clickable entities in order to keep you within the submission system and prevent mistakenly leaving a submission.
You do not need (or want) to enter the full URI for a link, as this will get converted into "this HTTPs URL" at announcement rather than `arXiv:YYMM.NNNNN` (or for the older formats, `arXiv:archive/YYMMNNN`). The `arXiv:` prefix is not required, but is considered the standard form of the canonical identifiers.
| 2 | https://tex.stackexchange.com/users/52244 | 693464 | 321,701 |
https://tex.stackexchange.com/questions/693462 | -1 | I would like to use `\hfill` (or it could be a similar command) the same way it works outside the math environment.
Right now I have
```
\begin{align*}
dw=ddf=0.
\end{align*} \hfill $\#$
```
But I would like to have the `$\#$` in the line above, because that is the way it is in the rest of the document.
I already tried
```
\begin{align*}
dw=ddf=0. \hskip0.7\textwidth
\end{align*}
```
but then the formula is no longer centered, which is no coherent with the rest of my document.
| https://tex.stackexchange.com/users/300642 | hfill in align environment, so that the formula is still centered | true |
```
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\noindent
X\dotfill X
\[ dw=ddf=0.\tag*{\#} \]
\end{document}
```
Note you should never use `align*` for single line equations or without `&`. `\[` or for numbered equations, the `equation` environment, will generally produce better vertical spacing for singe line equations. Without a `&` in an align you only have the left hand side of the equation, so it is set flush right.
`\tag*` produces an alternative label (without `(` `)` for the `*` form)
| 4 | https://tex.stackexchange.com/users/1090 | 693466 | 321,702 |
https://tex.stackexchange.com/questions/693470 | 0 | I'm working on a class file in Overleaf, and would like to be able to have the editing tab for the class file and the main file open at the same time, rather than needing to repeatedly switch between them. Is there a way to do this?
| https://tex.stackexchange.com/users/302425 | Editing multiple text files in Overleaf | false | Copy the project link into different tabs and select each file in each tab, then, you will be able to use the navigator shortcuts to change between tabs. When you select a file in a tab, this selection doesn't affect the file selected in the other tabs.
| 0 | https://tex.stackexchange.com/users/302207 | 693473 | 321,704 |
https://tex.stackexchange.com/questions/693471 | 0 | #### Summary of issue
I followed the [guide](https://web.archive.org/web/20160712215709/http://www.howtotex.com:80/tips-tricks/faster-latex-part-iv-use-a-precompiled-preamble/) linked in [this](https://tex.stackexchange.com/a/377033/179104) answer, and it works perfectly for me. However, I find that if I use a precompiled preamble, and then specify `\includeonly{}`, the full document is still compiled.
Is there something obvious I'm missing?
#### MWE
File: `main.tex`
>
> %&preamble
>
> \includeonly{part1}
>
> \begin{document}
>
> \include{part1}
>
> \include{part2}
>
> \end{document}
>
>
>
File: `preamble.tex`
>
> \documentclass{article}
>
> \usepackage{amsmath}
>
> \csname endofdump\endcsname
>
>
>
File: `part1.tex`
>
> Part 1.
>
>
>
File: `part2.tex`
>
> Part 2.
>
>
>
#### Precompilation
I precompiled the preamble using `pdftex -ini -jobname="preamble" "&pdflatex" mylatexformat.ltx "preamble.tex"`
If you change `%&preamble` in `main.tex` to `\input{preamble}`, it works as expected.
#### System info
Compiled under the LaTeX Workshop extension for Visual Studio Code on Windows 10, using latexmk.
| https://tex.stackexchange.com/users/179104 | \includeonly{} not Working with Precompiled Preamble | true | Once a document using the precompiled format starts being processed TeX skips over the preamble as far as `\endofdump` or `\begin{document}`. This allows a document to be used for both pre-compiling the format, and as the actual document, even though you used separate files here.
So you need to add `\csname endofdump\endcsname` to your main document at the point you want processing to start, before `\includeonly` otherwise no commands in the preamble will be executed.
| 0 | https://tex.stackexchange.com/users/1090 | 693479 | 321,706 |
https://tex.stackexchange.com/questions/693480 | 0 | With my beginner's knowledge, I could identify the portion of the code responsible for the destruction of the default class justification structure (Commenting that portion removes the problem). However, as the code is lend to me by a senior, I am not being able to correct it with my limited knowledge. Please help.
```
\documentclass[listof=totoc, a4paper, 11pt, oneside, chapterprefix=true, sfdefaults=false]{scrbook}
\usepackage{lipsum} % For generating dummy text
\usepackage[utf8]{inputenc}
%%%%%%%%% Header Footer begin
\usepackage[automark,headsepline,markcase=upper]{scrlayer-scrpage}
\automark[chapter]{chapter}
\clearpairofpagestyles
\setkomafont{pageheadfoot}{}
\setkomafont{pagefoot}{\bfseries\small}
\ohead{\headmark}
\lefoot*{\pagemark{} \rule[-\dp\strutbox]{1pt}{\baselineskip} Page}
\rofoot*{Page \rule[-\dp\strutbox]{1pt}{\baselineskip} \pagemark}
\ifoot*{MAKAUT, WB}
\AddToHook{cmd/frontmatter/after}{%
\renewcommand*{\chapterpagestyle}{empty}% instead of plain → manual
\pagestyle{empty}%
}
\AddToHook{cmd/mainmatter/after}{%
\renewcommand*{\chapterpagestyle}{plain}%
\pagestyle{headings}%
}
%%%%%%%%%Header Footer End
\usepackage[pass,a4paper]{geometry}
\usepackage{acronym}
\usepackage[T1]{fontenc}
\usepackage{setspace}
\usepackage[normalem]{ulem} % for underline with normalem option
\usepackage{ragged2e} % For justified text
%\usepackage[none]{./UbuntuFonts/ubuntu}
% Math packages
\usepackage{amssymb}
\usepackage{mathtools}
\usepackage{gensymb}
\usepackage{siunitx}
\usepackage{latexsym}
\usepackage{amsthm}
\usepackage{pdfpages}
\usepackage{hyperref}
\usepackage{graphicx}
%\graphicspath{{./images/}}
\usepackage{tabularx}
\usepackage{array}
\usepackage[inline]{asymptote}
\usepackage{eqparbox}
%\usepackage{subfig}
\usepackage[center]{caption}
\usepackage{subcaption}
\usepackage{float}
\usepackage[misc]{ifsym}
\usepackage{csquotes}
\usepackage[section]{placeins}
\usepackage{siunitx}
\usepackage{mdwmath}
\usepackage{mdwtab}
\usepackage{euler}
\usepackage{stmaryrd}
\usepackage{tikz}
\usetikzlibrary{calc}
\usepackage{enumerate}
%\usepackage[backend=bibtex,style=numeric, sorting=none]{biblatex}
%\addbibresource{References.bib}
\usepackage{multicol}% used for the two-column index
\usepackage[bottom]{footmisc}% places footnotes at page bottom
\usepackage{algorithm2e}
%Table packages
\usepackage[figuresright]{rotating}
\setlength{\rotFPtop}{0pt plus 1fil}
\usepackage{booktabs, makecell, multirow, tabularx}
\renewcommand{\theadfont}{\footnotesize\bfseries}
\renewcommand\theadgape{}
\newcolumntype{L}{>{\raggedright\arraybackslash}X}
\newcolumntype{P}[1]{>{\raggedright\arraybackslash}p{#1}}
\newenvironment{calligraphic}{\usefont{T1}{pzc}{m}{it}}{}
% Link setup
\hypersetup{
colorlinks = true, %Colours links instead of ugly boxes
urlcolor = blue, %Colour for external hyperlinks
linkcolor = blue, %Colour of internal links
citecolor = red %Colour of citations
}
%\makeindex
\begin{document}
\frontmatter
%\pagestyle{empty}
\setcounter{page}{1}
%\include{copyright}
%*********************Suspected portion begins ***********************
\begin{center}
\begin{tikzpicture}[remember picture,overlay]
% Top border
\draw[line width=2pt] ($(current page.north west)+(10cm,-10cm)$) -- ($(current page.north east)+(-10cm,-10cm)$);
% Bottom border
\draw[line width=2pt] ($(current page.south west)+(10cm,10cm)$) -- ($(current page.south east)+(-10cm,10cm)$);
% Text
\node[align=center, text width=\textwidth, font=\fontsize{30}{36}\selectfont] at (current page.center) {%
Dedicated\\In the loving memory of my father, whose unwavering encouragement and belief in my abilities have been a constant source of inspiration throughout my academic journey.};
\end{tikzpicture}
\end{center}
%%%%%%%%%%%%%
\newpage
\begin{calligraphic}
\begin{center}
\huge \textbf{Declaration}
\end{center}
\LARGE
{I hereby declare that this dissertation is the product of my own work, and I attest that it contains no material that resulted from collaboration, except where explicitly acknowledged in the text. Furthermore, I confirm that this dissertation has not been previously submitted, either in part or in its entirety, to any other University or Institution for the purpose of obtaining any degree, diploma, or other qualification. All sources used and referenced in this dissertation are duly credited, and any borrowed ideas or information are appropriately cited in accordance with academic standards and guidelines.\\~\\~\\}
\large {
\begin{tabular}{p{5cm}p{8cm}}
& \dotfill \\
Date: 27-10-2023 & \begin{center}( First LastName ) \end{center} \\
Place: MAKAUT, WB & PhD Registration Number: XXXXXXXXXXX \\
\end{tabular}
}
\end{calligraphic}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newpage
%\pagestyle{empty}
\setstretch{1.0}
% Start a new page with custom margins and alignment
\newgeometry{left=1cm, right=1cm, top=0.5cm, bottom=0.5cm} % Set custom margins
\Large \centering
{MAULANA ABUL KALAM AZAD UNIVERSITY OF TECHNOLOGY, WEST BENGAL\\
(Formerly WEST BENGAL UNIVERSITY OF TECHNOLOGY)\\
Main Campus: NH 12, Haringhata, Post Office - Simhat, Police Station – Haringhata, Pin - 741249\\
City Campus: BF-142, Sector -I, Salt Lake, Kolkata -700 064\\~\\}
\hrule
\vspace{1cm}
{\fontsize{20}{24}\selectfont % Set font size to 20pt with 24pt line spacing
\textbf{\underline{Declaration regarding originality of Ph.D. Thesis}}}
\begin{itemize}
\item Name, Designation \& Affiliation of Research Supervisor: $Dr.~ FirstName~ LastName$
\item Name of the Ph.D Scholar: $FirstName~ LastName$
\item Ph.D. Registration number with department:$ ~XXXXXXXX, Dept: CSE$
\item Title of the Thesis: $The~complete~ title~ of ~the~ thesis~ as~ per~ proposal$
\item \Large \uline{\textbf{Declaration by the Supervisor/Joint/Associate Supervisor/Research Scholar}\\~\\}
We declare that--
\begin{enumerate}
\item The similarity index of the submitted thesis is 4\% (write index in percentage)
\item This thesis/work is original and has not been submitted for the award of any other Degree / Diploma in any other University / Institutes.
\item We have faithfully acknowledged, given credit to and referred to the already published works whenever those works have been cited in the text and the body of the thesis.
\item We shall be responsible for any legal dispute / case(s) for violation of any provisions of the Anti-plagiarism policy / Copyright act / Piracy / Cyber/ IPR etc
\item If in case, any of the above information is found to be false or misleading, we are aware that we will be held liable for it and Maulana Abul Kalam Azad University of Technology (MAKAUT), West Bengal can take appropriate actions against us based on UGC Notification (F.1-18/2010(CPP-II), New Delhi, the 23rd July’2018) and its subsequent modifications.
\end{enumerate}
\end{itemize}
\vspace{2cm}
\begin{tabular}{p{7cm}p{7cm}}
\dotfill & \dotfill \\
( XXXXXXX, Scholar ) & (Dr.~XXXXXXX, Supervisor)\\
Date: & Date: \\
Place: MAKAUT, WB & Place: MAKAUT, WB\\
\end{tabular}
\restoregeometry
%********************Suspected portion ends *******************
%\include{certificate}
\tableofcontents
\listoftables
\listoffigures
%\include{acronyms}
%\include{Acknowledgement}
%\include{Publications Related to Thesis}
\addchap{Abstract}
\lipsum[5-6]
\mainmatter
\chapter{Introduction}
\lipsum[5-6]
\section{Motivation}
\lipsum[3-5]
Write Motivation of the research work
\section{Contribution}
\lipsum[5-6]
Write the thesis contribution
\section{Organization of thesis}
\lipsum[2-3]
Brief description of chapters in the thesis.
\subsection{Chapter 2: Literature Survey}
\lipsum[1-2]
\subsection{Chapter 3:}
\lipsum[1-2]
\subsection{Chapter 4:}
\lipsum[1-2]
\subsection{Chapter 5:}
\lipsum[1-2]
\subsection{Chapter 6:}
\lipsum[1-2]
\subsection{Chapter 7:}
\lipsum[1-2]
%\end{justify}
\backmatter
%\printbibliography
\end{document}
```
| https://tex.stackexchange.com/users/218773 | Rogue code destroying the default justification--Please help | true | You have
```
\Large \centering
```
on line 131 applying large centering to the entire document, change that to
```
% \Large %\centering
```
and you get:
| 2 | https://tex.stackexchange.com/users/1090 | 693483 | 321,708 |
https://tex.stackexchange.com/questions/693465 | 4 | To save space in tables, I want to reduce the tracking in the words. To do this I am using code from [here](https://tex.stackexchange.com/a/95898/176762).
The code below works correctly and is displayed as expected, but for every occurence of \test I am getting a warning like this:
`Package microtype Warning: tracking amount list `output.tex/8' will override list `default' for font `OT1////' on input line 8.`
I wasn't able to figure out why this happens, maybe someone with deeper insight could help me out here.
```
\documentclass{article}
\usepackage{microtype}
\newcommand\narrowstyle{\SetTracking{encoding=*}{-50}\lsstyle}
\newcommand{\test}{\narrowstyle Test}
\begin{document}
\test\test\test
\end{document}
```
| https://tex.stackexchange.com/users/176762 | microtype Tracking warning | false | If you're absolutely sure that the warning messages are innocuous, you could load the `microtype` package with the option `verbose=silent`.
Incidentally, I would replace
```
\newcommand{\test}{\narrowstyle Test}
```
with
```
\newcommand{\test}{{\narrowstyle Test}}
```
in order to limit the scope of `\narrowstyle`.
For more on this option, see section 3.5, entitled "Miscellaneous options" of the user guide of the `microtype` package.
```
\documentclass{article}
\usepackage[verbose=silent]{microtype}
\newcommand\narrowstyle{\SetTracking{encoding=*}{-50}\lsstyle}
\newcommand{\test}{{\narrowstyle Test}}
\begin{document}
\test\test\test --- looks dreadful
TestTestTest --- default
\end{document}
```
| 3 | https://tex.stackexchange.com/users/5001 | 693487 | 321,709 |
https://tex.stackexchange.com/questions/693484 | 0 | I am trying to come up with a new enumerated list environment "stepslist" such that the items are marked with "Step k of n", where n is the total number of items in one stepslist environment, and k is the kth item in it. Thus e.g. the code
```
\begin{stepslist}
\item A
\item B
\item C
\end{stepslist}
```
ought to render as:
>
> Step 1 of 3: A
>
>
> Step 2 of 3: B
>
>
> Step 3 of 3: C
>
>
>
and
```
\begin{stepslist}
\item A
\item B
\item C
\item D
\end{stepslist}
```
ought to render as:
>
> Step 1 of 4: A
>
>
> Step 2 of 4: B
>
>
> Step 3 of 4: C
>
>
> Step 4 of 4: D
>
>
>
I don't want to define the variable n myself; I want its value to be determined automatically by the macro. Conversations with GPT4 suggest a "two-pass approach" (which makes sense, since as I understand it `LaTeX` does not know at the beginning of a list environment how many items there are in it).
I am unaware if this can even be done, but if it can then I would appreciate a method that would work in Overleaf.
| https://tex.stackexchange.com/users/65997 | Stepslist: "Step k of n" | true | You can set a label which counts the items:
```
\documentclass{article}
\usepackage{enumitem} %
\newlist{stepslist}{enumerate}{1}
\setlist[stepslist,1]{label={Step \arabic* of \ref{steplist:\themylistcnt}:},ref=\arabic{stepslisti}}
\newcounter{mylistcnt} % for a unique label
\AddToHook{env/stepslist/begin}{\stepcounter{mylistcnt}}
\AddToHook{env/stepslist/end}{\label{steplist:\themylistcnt}}
\begin{document}
\begin{stepslist}
\item A
\item B
\item C
\item D
\end{stepslist}
\begin{stepslist}
\item A
\item B
\item C
\end{stepslist}
\end{document}
```
| 3 | https://tex.stackexchange.com/users/2388 | 693490 | 321,710 |
https://tex.stackexchange.com/questions/558986 | 7 | I have long URLs in my references and I want to submit my paper to arxiv.org.
They use TexLive 2016.
I tried to follow advice at
[Line breaks of long URLs in biblatex bibliography?](https://tex.stackexchange.com/questions/134191/line-breaks-of-long-urls-in-biblatex-bibliography)
[URLs in bibliography: LaTeX not breaking line as expected](https://tex.stackexchange.com/questions/115690/urls-in-bibliography-latex-not-breaking-line-as-expected)
to no avail. Interestingly, arxiv.org expects .bbl file, not the .bib file.
I tried to manually insert '\-' hyphenation into the .bbl file but that didn't work.
How can I break long URLs on arxiv.org?
| https://tex.stackexchange.com/users/27523 | Breaking long URLs on Arxiv.org | false | Same answer as Gergely's but without the hyphen option for url
```
\usepackage{url}
\usepackage{hyperref}
\usepackage[hyphenbreaks]{breakurl}
```
| 0 | https://tex.stackexchange.com/users/290980 | 693491 | 321,711 |
https://tex.stackexchange.com/questions/693465 | 4 | To save space in tables, I want to reduce the tracking in the words. To do this I am using code from [here](https://tex.stackexchange.com/a/95898/176762).
The code below works correctly and is displayed as expected, but for every occurence of \test I am getting a warning like this:
`Package microtype Warning: tracking amount list `output.tex/8' will override list `default' for font `OT1////' on input line 8.`
I wasn't able to figure out why this happens, maybe someone with deeper insight could help me out here.
```
\documentclass{article}
\usepackage{microtype}
\newcommand\narrowstyle{\SetTracking{encoding=*}{-50}\lsstyle}
\newcommand{\test}{\narrowstyle Test}
\begin{document}
\test\test\test
\end{document}
```
| https://tex.stackexchange.com/users/176762 | microtype Tracking warning | true | I ended up using `\textls` instead, which works fine and without errors and doesn't require silencing any errors (though that is also a helpful option):
```
\documentclass{article}
\usepackage{microtype}
\newcommand\narrowstyle[1]{\textls[-50]{#1}}
\newcommand{\test}{\narrowstyle{Test}}
\begin{document}
\test\test\test
\end{document}
```
Note that if you wanted to keep the original semantics, @Roberts answer is probably the best option:
```
\SetTracking[context=narrow]{encoding=*}{-50}
\newcommand\narrowstyle{\microtypecontext{tracking=narrow}}
```
| 1 | https://tex.stackexchange.com/users/176762 | 693492 | 321,712 |
https://tex.stackexchange.com/questions/693493 | 16 | Online Judges are platforms used in competitive programming. Participants write code that solves a problem. Competitors submit their programs to the online judge, which runs all pieces of code in the grading server under the same predetermined input (if any) and environment. The judge compares the output of the programs with the correct output and determines whether the participants solved the task or not.
I was upset when I was forced to ditch my favorite language because major coding competitions did not support it. Now I am working on a project to incorporate as many languages as possible to an online judge, focusing on unpopular languages. Recently I successfully integrated \*sh and powershell. While searching for new candidates, the TeX family came to mind. It would be a fabulous addition to the group.
My plan was to compile, collate all PDF pages to a long image, OCR it then compare it with the right output. That is, `pdflatex | pdftocairo | tesseract | diff`. However I was met with numerous challenges. Since TeX writes to PDF which has a length limit, problems that require users to output a long line of text cannot be judged properly.
For example, consider a basic problem that asks contestants to simply print the numbers 1 to 100 in a line, separated by one space. Using C, one could do this:
```
$ cat ./example.c
#include <stdio.h>
int main() {
for (int i = 1; i <= 100; i++) {
printf("%d ", i);
}
return 0;
}
```
The code would be judged by this process:
```
$ gcc ./example.c -o ./example.o
$ ./example.o
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
```
This would be diffed and the online judge would rule it correct. However in LaTeX the output would inevitably span on multiple lines, resulting in a different output when ocr'd. Formatting matters in competitive programming and this cannot be deemed correct. I can't modify tesseract params to assume all output is in one line, since that would break any question that requires more than two lines of output. Giving exemptions to TeX would be unfair for other languages.
```
$ cat ./example.tex
\documentclass{article}
\usepackage{pgffor}
\pagenumbering{gobble}
\begin{document}
\foreach \i in {1,...,100} {%
\i\space%
}%
\end{document}
```
```
$ pdflatex ./example.tex
$ pdftocairo ./example.pdf -jpeg -singlefile
$ tesseract -c debug_file=/dev/null ./example.jpg -
123456789 1011 12 13 1415 1617 18 19 20 21 22 23 24 25 26 27 28
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
```
Not only does the output span over multiple lines, numbers 1 to 9 were erroneously combined into a single string by tesseract. Would there be a feasible way to adjust this procedure so that there would be a reliable automated grading system for TeX akin to other established languages that would not give it a disadvantage nor an advantage?
If this is not viable the only other way would be to make TeX output to stdout or a plaintext file like all others. Can TeX be instructed to do this?
| https://tex.stackexchange.com/users/302437 | Evaluating TeX output in competitive programming | true |
```
\documentclass{article}
\usepackage{pgffor}
\pagenumbering{gobble}
\newwrite\res
\immediate\openout\res=\jobname.txt
\begin{document}
\def\x{}
\foreach \i in {1,...,100} {%
\xdef\x{\x\i\space}
}%
\immediate\write\res{\x}
\end{document}
```
leaves a 1-line text file `.txt` extension containing
```
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
```
| 21 | https://tex.stackexchange.com/users/1090 | 693494 | 321,713 |
https://tex.stackexchange.com/questions/693493 | 16 | Online Judges are platforms used in competitive programming. Participants write code that solves a problem. Competitors submit their programs to the online judge, which runs all pieces of code in the grading server under the same predetermined input (if any) and environment. The judge compares the output of the programs with the correct output and determines whether the participants solved the task or not.
I was upset when I was forced to ditch my favorite language because major coding competitions did not support it. Now I am working on a project to incorporate as many languages as possible to an online judge, focusing on unpopular languages. Recently I successfully integrated \*sh and powershell. While searching for new candidates, the TeX family came to mind. It would be a fabulous addition to the group.
My plan was to compile, collate all PDF pages to a long image, OCR it then compare it with the right output. That is, `pdflatex | pdftocairo | tesseract | diff`. However I was met with numerous challenges. Since TeX writes to PDF which has a length limit, problems that require users to output a long line of text cannot be judged properly.
For example, consider a basic problem that asks contestants to simply print the numbers 1 to 100 in a line, separated by one space. Using C, one could do this:
```
$ cat ./example.c
#include <stdio.h>
int main() {
for (int i = 1; i <= 100; i++) {
printf("%d ", i);
}
return 0;
}
```
The code would be judged by this process:
```
$ gcc ./example.c -o ./example.o
$ ./example.o
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
```
This would be diffed and the online judge would rule it correct. However in LaTeX the output would inevitably span on multiple lines, resulting in a different output when ocr'd. Formatting matters in competitive programming and this cannot be deemed correct. I can't modify tesseract params to assume all output is in one line, since that would break any question that requires more than two lines of output. Giving exemptions to TeX would be unfair for other languages.
```
$ cat ./example.tex
\documentclass{article}
\usepackage{pgffor}
\pagenumbering{gobble}
\begin{document}
\foreach \i in {1,...,100} {%
\i\space%
}%
\end{document}
```
```
$ pdflatex ./example.tex
$ pdftocairo ./example.pdf -jpeg -singlefile
$ tesseract -c debug_file=/dev/null ./example.jpg -
123456789 1011 12 13 1415 1617 18 19 20 21 22 23 24 25 26 27 28
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
```
Not only does the output span over multiple lines, numbers 1 to 9 were erroneously combined into a single string by tesseract. Would there be a feasible way to adjust this procedure so that there would be a reliable automated grading system for TeX akin to other established languages that would not give it a disadvantage nor an advantage?
If this is not viable the only other way would be to make TeX output to stdout or a plaintext file like all others. Can TeX be instructed to do this?
| https://tex.stackexchange.com/users/302437 | Evaluating TeX output in competitive programming | false | The following creates a file with the same name as your .tex-file but with the extension .txt that will contain all numbers from 1 to 100 followed by a space.
This example uses the L3 language, which adds a coherent programming language to TeX (still by macro expansion).
```
\ExplSyntaxOn
\iow_open:Nn \g_tmpa_iow { \jobname.txt }
\tl_clear:N \l_tmpa_tl
\int_step_inline:nn { 100 } { \tl_put_right:Nn \l_tmpa_tl { #1~ } }
\iow_now:Nx \g_tmpa_iow { \l_tmpa_tl }
\iow_close:N \g_tmpa_iow
\stop
```
Results in
```
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
```
Another possibility instead of using many calls to `\tl_put_right:Nn` is using the `\tl_build_...` functions, which provide much better performance for piece-wise build token lists.
```
\ExplSyntaxOn
\iow_open:Nn \g_tmpa_iow { \jobname.txt }
\tl_build_begin:N \l_tmpa_tl
\int_step_inline:nn { 100 } { \tl_build_put_right:Nn \l_tmpa_tl { #1~ } }
\tl_build_end:N \l_tmpa_tl
\iow_now:Nx \g_tmpa_iow { \l_tmpa_tl }
\iow_close:N \g_tmpa_iow
\stop
```
---
A slightly shorter code variant using an expandable function to map over the integers from 1 to 100 and an expandable macro adding a space (TeX can be weird when it comes to stuff being expandable or not, so this might be the harder to use variant in writing to a file if you have more complicated things to be done):
```
\ExplSyntaxOn
\iow_open:Nn \g_tmpa_iow { \jobname.txt }
\cs_new:Nn \my_addspace:n { #1~ }
\iow_now:Nx \g_tmpa_iow { \int_step_function:nN { 100 } \my_addspace:n }
\iow_close:N \g_tmpa_iow
\stop
```
And a fully expandable variant with even better performance:
```
\ExplSyntaxOn
\iow_open:Nn \g_tmpa_iow { \jobname.txt }
\cs_new:Npn \my_spaceloop:nN #1#2
{ #1~ \exp_args:Ne #2 { \int_eval:n { #1 + 1 } } }
\iow_now:Nx \g_tmpa_iow
{
\exp_args:NNNo \exp_last_unbraced:NNo \my_spaceloop:nN 1
{ \prg_replicate:nn {99} \my_spaceloop:nN }
\use_none:n
}
\iow_close:N \g_tmpa_iow
\stop
```
| 16 | https://tex.stackexchange.com/users/117050 | 693497 | 321,714 |
https://tex.stackexchange.com/questions/693496 | 0 |
```
\begin{mdframed}[innertopmargin=6bp, innerbottommargin=4b, innerleftmargin=8bp, backgroundcolor=yellow!10, nobreak= true]
\begin{thm}
\label{thm:them2}
{Assuming that the sizes of the matrices allow for the operations, the following rules of matrix arithmetic are valid}
\begin{enumerate}[nosep, label=(\alph*)]
%\setlength{\itemsep}{0pt}
\item $A + B = B + A$ \; \textit{Additive Commutativity}
\item $A + (B + C) = (A + B) + C$ \; \textit{Additive Associativity}
\item $A(BC) = (AB)C$ \; \textit{Multiplicative Associativity}
\item $A(B+C) = AB + AC$ \; \textit{Distributive Law}
\item $(B+C)A = BA + CA$ \; \textit{Distributive Law}
\begin{multicols}{2}
\item $a(B + C) = aB + aC$
\item $(ab)C = a(bC)$
\item $a(BC) = (aB)C = B(aC)$
\item $A + 0 = 0 + A = A$
\item $A - A = 0$
\item $0 - A = -A$
\item $A0 = 0$ and $0A = 0$
\end{multicols}
\end{enumerate}
\end{thm}
\end{mdframed}
```
| https://tex.stackexchange.com/users/301174 | Latex enumerate overwrites the first item label over the second, so that the a and b are on top of each other | false |
You need some additional packages which were presumably missing from your unshown code:
```
\documentclass{article}
\usepackage{mdframed}
\usepackage{multicol}
\usepackage{xcolor}
\usepackage{enumitem}
\newtheorem{thm}{Theorem}
\begin{document}
\begin{mdframed}[innertopmargin=6bp, innerbottommargin=4bp, innerleftmargin=8bp, backgroundcolor=yellow!10, nobreak= true]
\begin{thm}
\label{thm:them2}
{Assuming that the sizes of the matrices allow for the operations, the following rules of matrix arithmetic are valid}
\begin{enumerate}[nosep, label=(\alph*)]
%\setlength{\itemsep}{0pt}
\item $A + B = B + A$ \; \textit{Additive Commutativity}
\item $A + (B + C) = (A + B) + C$ \; \textit{Additive Associativity}
\item $A(BC) = (AB)C$ \; \textit{Multiplicative Associativity}
\item $A(B+C) = AB + AC$ \; \textit{Distributive Law}
\item $(B+C)A = BA + CA$ \; \textit{Distributive Law}
\begin{multicols}{2}
\item $a(B + C) = aB + aC$
\item $(ab)C = a(bC)$
\item $a(BC) = (aB)C = B(aC)$
\item $A + 0 = 0 + A = A$
\item $A - A = 0$
\item $0 - A = -A$
\item $A0 = 0$ and $0A = 0$
\end{multicols}
\end{enumerate}
\end{thm}
\end{mdframed}
\end{document}
```
| 1 | https://tex.stackexchange.com/users/1090 | 693502 | 321,715 |
https://tex.stackexchange.com/questions/693501 | 2 | I use LaTeX on my Macbook through VSCode and the LaTeX workshop extension. This lets me edit my documents with a real time preview. I don't use (and have no plan to) any of the other programs that were installed when I downloaded LaTeX on my machine. Specifically, I would like to get rid of TeX Live Utility but there is also TeXShop and LaTeXiT that I would like to remove.
I am not sure how LaTeX installations work in terms of structure, but would it be safe to delete these files from my Applications folder? Or would this cause issues with my LaTeX installation(s)?
| https://tex.stackexchange.com/users/302444 | Can you safely remove TeX Live Utility on macOS? | false | TeX Live Utility is a GUI wrapper for `tlmgr` which allows you to keep your distribution up-to-date. It will not cause any problems to delete it, but it only takes 120 Mb of space, and is extremely useful. See
* [TeX Live Utility, don't know how to start it](https://tex.stackexchange.com/q/254375/2693)
for an explanation of how to use it and what it does.
If you do decide to delete it, then you must use `sudo tlmgr` from the command line to update your distribution. Personally, this is not something that I ever do, despite the fact that I do many other things from the command line. TeX Live Utility is a great app, and I really don't see any reason not to use it.
TeXShop is a great editor, but if you're happy with VSCode then by all means delete it. LaTeXit is also a useful app, although it can easily be replicated with the `standalone` class, so this is the least useful of the included apps in my opinion.
You didn't mention BibDesk, but if you plan to use `bibtex` at all for your writing, then it is another excellent app included with MacTeX that I would not recommend deleting.
| 2 | https://tex.stackexchange.com/users/2693 | 693503 | 321,716 |
https://tex.stackexchange.com/questions/24762 | 2 | When compiling a LaTeX document with XeTeX, I get the following error:
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! You are attempting to make a LaTeX format from a source file
! That is more than five years old.
!
! If you enter to scroll past this message then the format
! will be built, but please consider obtaining newer source files
! before continuing to build LaTeX.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
```
! LaTeX source files more than 5 years old!.
l.545 ...aTeX source files more than 5 years old!}
?
! Emergency stop.
l.545 ...aTeX source files more than 5 years old!}
No pages of output.
```
I invoked the command with `xelatex document.tex`, what am I doing wrong? `LaTeX` and `XeTeX` was installed from repos of Fedora 15, how come those sources are too old?
Edit:
-----
I was asked to provide an example where this error occurs:
```
\documentclass[pdftex, paper=a4, 11pt]{scrartcl}
\title{title}
\begin{document}
%\maketitle
\section*{test}
blah blah
\end{document}
```
I could further simplify, if that helps...
| https://tex.stackexchange.com/users/4147 | XeLaTeX fails, claims LaTeX sources older than 5 years | false | I have been using **Miktex 2.6** version on Windows PC. This isn't my original answer, however **it works**. **This message is meant to force people to use later versions**. When I got the above error message **That is more than five years old** the solution is search for the file **latex.ltx** in your latex distribution. Make its duplicate on the desktop or elsewhere. Open it using Notepad. Within the file **Search for the lines** containing 65 as shown below.
```
\ifnum\count@>65
\typeout{^^J%
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!^^J%
! You are attempting to make a LaTeX format from a source file^^J%
! That is more than five years old.^^J%
!^^J%
! If you enter <return> to scroll past this message then the format^^J%
! will be built, but please consider obtaining newer source files^^J%
! before continuing to build LaTeX.^^J%
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!^^J%
}
\errhelp{To avoid this error message, obtain new LaTeX sources.}
\errmessage{LaTeX source files more than 5 years old!}
\fi
```
In the latex.ltx file, change **65 to 300 and save it**. Then **replace the original latex.ltx file in the distribution with the duplicate** from the desktop. That should solve the problem.
| -1 | https://tex.stackexchange.com/users/220152 | 693513 | 321,718 |
https://tex.stackexchange.com/questions/693511 | 0 | For an unknown reason the code doesn't compile.
```
\begin{figure}
\centering
\begin{tikzpicture}
\begin{axis}[
xlabel=Month,
ylabel=Rainfall (mm),
ymin=80,
ymax=450,
date coordinates in=x,
xticklabel style={rotate=45, anchor=near xticklabel},
xticklabel={\month},
date ZERO=2021.12.31, % reference date
xtick={
2022-01-01,
2022-02-01,
2022-03-01,
2022-04-01,
2022-05-01,
2022-06-01,
2022-07-01,
2022-08-01,
2022-09-01,
2022-10-01,
2022-11-01,
2022-12-01
},
xticklabel style={/pgf/number format/1000 sep=,rotate=45,anchor=north east},
]
\addplot coordinates {
(2022-01-01, 81.9)
(2022-02-01, 70)
(2022-03-01, 104.9)
(2022-04-01, 276.2)
(2022-05-01, 311.6)
(2022-06-01, 201.5)
(2022-07-01, 132.5)
(2022-08-01, 108.5)
(2022-09-01, 248.8)
(2022-10-01, 399.1)
(2022-11-01, 362.4)
(2022-12-01, 165.1)
};
\end{axis}
\end{tikzpicture}
\caption{Average Monthly Total Rainfall}
\end{figure}
```
| https://tex.stackexchange.com/users/302456 | Drawing a line graph | false | Looks like you are close. Kindly see my changes below:
* used `standalone`, which is more gentle when developing graphics (switch back later)
* commented out almost everything inside the `axis`, until it compiled without error (and empty content)
* the line containing `2022-08-01` said, it can't deal with the `8` (and the ones thereafter)
* added `\usepgfplotslibrary{dateplot}`, reentered said dataline
* finally the code shown below compiled
So finetuning is still needed. I suggest to remove the comments (=line deletions) step-by-step-with-compiles to ensure, it still compiles AND things move into the right direction.
This way you can localize problems when they occure (and sometimes it's a good idea to disable those lines and leave solutions for later ... often they are gone, anyway).
```
\documentclass[10pt,border=3mm,tikz]{standalone}
\usepackage{pgfplots}
\usepgfplotslibrary{dateplot}% <<< perhaps you used it already?
\begin{document}
\begin{tikzpicture}
\begin{axis}[
% xlabel=Month,
% ylabel=Rainfall (mm),
% ymin=80,
% ymax=450,
date coordinates in=x,% <<< was necessary
% xticklabel style={rotate=45, anchor=near xticklabel},
% xticklabel={\month},
% date ZERO=2021.12.31, % reference date
% xtick={
% 2022-01-01,
% 2022-02-01,
% 2022-03-01,
% 2022-04-01,
% 2022-05-01,
% 2022-06-01,
% 2022-07-01,
% 2022-08-01,
% 2022-09-01,
% 2022-10-01,
% 2022-11-01,
% 2022-12-01
% },
% xticklabel style={/pgf/number format/1000 sep=,rotate=45,anchor=north east},
]
\addplot coordinates {
(2022-01-01, 81.9)
(2022-02-01, 70)
(2022-03-01, 104.9)
(2022-04-01, 276.2)
(2022-05-01, 311.6)
(2022-06-01, 201.5)
(2022-07-01, 132.5)
(2022-08-01, 108.5)
(2022-09-01, 248.8)
(2022-10-01, 399.1)
(2022-11-01, 362.4)
(2022-12-01, 165.1)
};
\end{axis}
\end{tikzpicture}
\end{document}
```
| 1 | https://tex.stackexchange.com/users/245790 | 693526 | 321,726 |
https://tex.stackexchange.com/questions/407663 | 1 | I tried following code but this code put logo on second page.
```
\documentclass[journal,article,submit,moreauthors,pdftex,10pt,a4paper]{mdpi}
\usepackage{fancyhdr}
\pagestyle{fancy}
\begin{document}
\lhead{\includegraphics[width = 0.3\textwidth]{nanomaterials-logo.png}}
\end{document}
```
| https://tex.stackexchange.com/users/151360 | How to add logo on the title page (top left corner) for MDPI journals? | false | The class option "submit" will be changed to "accept" by the Editorial Office when the paper is accepted. This will only make changes to the frontpage (e.g., the logo of the journal will get visible), the headings, and the copyright information. Also, line numbering will be removed. Journal info and pagination for accepted papers will also be assigned by the Editorial Office.
| 0 | https://tex.stackexchange.com/users/302468 | 693527 | 321,727 |
https://tex.stackexchange.com/questions/693534 | 0 | In bib file, I used like this:
```
@article{novoselov2004electric,
title={{}},
author={K.S. Novoselov, A.K. Geim, S.V. Morozov, D. Jiang, Y. Zhang, S.V. Dubonos, I.V. Grigorieva, A.A. Firsov},
journal="Science",
year="2004",
volume="306",
pages="666--669",
publisher={American Association for the Advancement of Science}
}
```
In pdf it is coming as follows:
```
V. Morozov D. Jiang Y. Zhang S.V. Dubonos I.V. Grigorieva A.A. Firsov K.S. Novoselov, A.K. Geim.
. Science, 306:666–669, 2004.
```
Please see that, authors ordering has been changed. Also year should come after Science. Name of publisher should also come. I am using \bibliographystyle{unsrt}
How to tackle this?
| https://tex.stackexchange.com/users/302471 | Bibliography style: PDF should follow exactly the same bib file | false | Authors should be separated by `and` not `,` .
Commas are used to separate `surname, first names` so your bib file entry has just one author with a very long name.
```
author={K.S. Novoselov and A.K. Geim and S.V. Morozov
and D. Jiang and Y. Zhang and S.V. Dubonos
and I.V. Grigorieva and A.A. Firsov}
```
| 2 | https://tex.stackexchange.com/users/1090 | 693536 | 321,731 |
https://tex.stackexchange.com/questions/265727 | 2 | Related to [Make first row of table all bold](https://tex.stackexchange.com/questions/4811/make-first-row-of-table-all-bold), however the solution seems not to be transferable to striking text through (see [Strikethrough command that affects all following text, like \bfseries](https://tex.stackexchange.com/questions/262021/strikethrough-command-that-affects-all-following-text-like-bfseries)).
So far my solution works by overlaying the respective line with
```
\renewcommand{\sttableline}{\rlap{\rule[3pt]{1\paperwidth}{.4pt}}}
```
through a command in the spirit of my first referenced Q&A above. This is however very unflexible and needs manual adjustment depending on how the respective table is scaled/placed on the page.
**Edit**: Idealy the solution I'm looking for would work withou any modification in the last columns and only need modification of the table header and entries in the first columns.
| https://tex.stackexchange.com/users/33758 | Make whole line of a table stroke through | false | Here is a solution with `{NiceTabular}` of `nicematrix`. That environment is similar to the classical `{tabular}` (of the package `array`) but adds PGF/Tikz nodes under the rows, columns and cells. It's possible to use those nodes in the so-called `\CodeAfter` to draw with Tikz whatever rule you want.
```
\documentclass{article}
\usepackage{nicematrix,tikz}
\usepackage{booktabs}
\begin{document}
\begin{NiceTabular}{ccc}
\toprule
Sandra & Alexandra & Anne \\
Luc & Claude & Jean \\
Paul & Pierre & Jacques \\
Laurence & Sophie & Lucie \\
\bottomrule
\CodeAfter
\tikz \draw (3.5-|1) -- (3.5-|last) ;
\end{NiceTabular}
\end{document}
```
If you prefer a syntax with a command `\Strike` in the beginning of the row to strike, it's also possible:
```
\documentclass{article}
\usepackage{nicematrix,tikz}
\usepackage{booktabs}
\ExplSyntaxOn
\NewDocumentCommand{\Strike}{}
{
\tl_gput_right:Nx \g_nicematrix_code_after_tl
{ \shess_strike:n { \arabic { iRow } } }
\ignorespaces
}
\cs_new_protected:Nn \shess_strike:n
{ \tikz \draw (#1.5-|1) -- (#1.5-|last) ; }
\ExplSyntaxOff
\begin{document}
\begin{NiceTabular}{ccc}
\toprule
Sandra & Alexandra & Anne \\
\Strike Luc & Claude & Jean \\
Paul & Pierre & Jacques \\
Laurence & Sophie & Lucie \\
\bottomrule
\end{NiceTabular}
\end{document}
```
`\g_nicematrix_code_after_tl` is a parameter of `nicematrix`, internal but public, which corresponds to the so-called `\CodeAfter`.
| 0 | https://tex.stackexchange.com/users/163000 | 693537 | 321,732 |
https://tex.stackexchange.com/questions/693540 | 1 | I want to create two new commands for new bullets in `\itemize`. A green `+` for `\pro` and a red `-` for `\con`, the text should be default black. I know how to change the symbols and the color alone, but how to combine both commands I don't know. At this point I just have:
```
\documentclass{beamer}
\usetheme{Boadilla}
\usecolortheme{default}
% PACKAGES
\usepackage[utf8]{inputenc}
\usepackage{babel}[ngerman]
\usepackage{booktabs}
% COMMANDS
\newcommand{\pro}{\item[$+$]}
\newcommand{\con}{\item[$-$]}
\begin{document}
\begin{frame}{Grundlagen}
\begin{itemize}
\pro has to be green
\con has to be red
\end{itemize}
\end{document}
```
It's probably very simple, but I haven't figured it out yet. Can someone tell me the full command?
| https://tex.stackexchange.com/users/297952 | Change color and bullet of \itemize together | true | You can stick your desired colour inside of your `\pro`/`\con` definitions:
```
\documentclass{beamer}
\usetheme{Boadilla}
\usecolortheme{default}
% PACKAGES
%\usepackage[utf8]{inputenc}
\usepackage{babel}[ngerman]
\usepackage{booktabs}
% COMMANDS
\newcommand<>{\pro}{\item#1[\color{green}$+$]}
\newcommand<>{\con}{\item#1[\color{red}$-$]}
\begin{document}
\begin{frame}
\frametitle{Grundlagen}
\begin{itemize}
\pro has to be green
\con has to be red
\end{itemize}
\end{frame}
\end{document}
```
| 1 | https://tex.stackexchange.com/users/36296 | 693541 | 321,733 |
https://tex.stackexchange.com/questions/577405 | 1 | I'm using vscode with the LaTeX Workshop extension (plain instalation).
My document looks like this:
```
\documentclass{article}
\usepackage{nomencl}
\makenomenclature
\nomenclature{$\delta x$}{variación de $x$}
\nomenclature{$\delta_x$}{incertidumbre de $x$}
\begin{document}
\printnomenclature
\end{document}
```
The file compiles but however it doesn't show the nomenclature in the pdf.
I read that I had to do some other steps when compiling but I don't know exactly what those are and I can't find the file where to add those.
| https://tex.stackexchange.com/users/232181 | \printnomenclature doesn't work | true | I had the same issue and **solved it by changing the latex recipe** used to build the latex document.
After running LaTeX on your source file (e.g., filename.tex), you need to run makeindex to generate the nomenclature list. The command for this is usually:
```
makeindex filename.nlo -s nomencl.ist -o filename.nls
```
This step is crucial. If you skip it, the nomenclature will not be generated. Since you are using LaTeX Workshop in VSCode, you might need to configure the build recipe to include this step.
This can be done by editing your settings.json in VSCode.
You can access settings.json under **Files->Preferences->Settings**
Then go to Extensions and click on **"Edit in settings.json"**.
```
{
"some.existing.setting": "value",
"another.setting": "another value",
"latex-workshop.latex.recipes": [
{
"name": "pdflatex - makenomenclature - pdflatex x2",
"tools": [
"pdflatex",
"makenomenclature",
"pdflatex",
"pdflatex"
]
}
],
"latex-workshop.latex.tools": [
{
"name": "makenomenclature",
"command": "makenomenclature",
"args": [
"%DOCFILE%.nlo",
"-s",
"nomencl.ist",
"-o",
"%DOCFILE%.nls"
]
},
{
"name": "pdflatex",
"command": "pdflatex",
"args": [
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"%DOC%"
]
}
]
}
```
| 1 | https://tex.stackexchange.com/users/281934 | 693543 | 321,735 |
https://tex.stackexchange.com/questions/693493 | 16 | Online Judges are platforms used in competitive programming. Participants write code that solves a problem. Competitors submit their programs to the online judge, which runs all pieces of code in the grading server under the same predetermined input (if any) and environment. The judge compares the output of the programs with the correct output and determines whether the participants solved the task or not.
I was upset when I was forced to ditch my favorite language because major coding competitions did not support it. Now I am working on a project to incorporate as many languages as possible to an online judge, focusing on unpopular languages. Recently I successfully integrated \*sh and powershell. While searching for new candidates, the TeX family came to mind. It would be a fabulous addition to the group.
My plan was to compile, collate all PDF pages to a long image, OCR it then compare it with the right output. That is, `pdflatex | pdftocairo | tesseract | diff`. However I was met with numerous challenges. Since TeX writes to PDF which has a length limit, problems that require users to output a long line of text cannot be judged properly.
For example, consider a basic problem that asks contestants to simply print the numbers 1 to 100 in a line, separated by one space. Using C, one could do this:
```
$ cat ./example.c
#include <stdio.h>
int main() {
for (int i = 1; i <= 100; i++) {
printf("%d ", i);
}
return 0;
}
```
The code would be judged by this process:
```
$ gcc ./example.c -o ./example.o
$ ./example.o
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
```
This would be diffed and the online judge would rule it correct. However in LaTeX the output would inevitably span on multiple lines, resulting in a different output when ocr'd. Formatting matters in competitive programming and this cannot be deemed correct. I can't modify tesseract params to assume all output is in one line, since that would break any question that requires more than two lines of output. Giving exemptions to TeX would be unfair for other languages.
```
$ cat ./example.tex
\documentclass{article}
\usepackage{pgffor}
\pagenumbering{gobble}
\begin{document}
\foreach \i in {1,...,100} {%
\i\space%
}%
\end{document}
```
```
$ pdflatex ./example.tex
$ pdftocairo ./example.pdf -jpeg -singlefile
$ tesseract -c debug_file=/dev/null ./example.jpg -
123456789 1011 12 13 1415 1617 18 19 20 21 22 23 24 25 26 27 28
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
```
Not only does the output span over multiple lines, numbers 1 to 9 were erroneously combined into a single string by tesseract. Would there be a feasible way to adjust this procedure so that there would be a reliable automated grading system for TeX akin to other established languages that would not give it a disadvantage nor an advantage?
If this is not viable the only other way would be to make TeX output to stdout or a plaintext file like all others. Can TeX be instructed to do this?
| https://tex.stackexchange.com/users/302437 | Evaluating TeX output in competitive programming | false | The other answers change the input document, one a bit more radical than the other. This may not be desired for a programming competition, where you would want to judge somewhat 'natural' code.
Instead of compiling to pdf you could also compile to html using `tex4ht`. This allows the input to be the same, and produces a html file containing plain text which may be easier to diff than PDF+OCR over multiple lines etc.
Basic example:
`example.tex`
```
\documentclass{article}
\usepackage{pgffor}
\pagenumbering{gobble}
\begin{document}
\foreach \i in {1,...,100} {%
\i\space%
}%
\end{document}
```
```
make4ht example.tex
```
Resulting `example.html`:
```
<!DOCTYPE html>
<html lang='en-US' xml:lang='en-US'>
<head><title></title>
<meta charset='utf-8' />
<meta content='TeX4ht (https://tug.org/tex4ht/)' name='generator' />
<meta content='width=device-width,initial-scale=1' name='viewport' />
<link href='example.css' rel='stylesheet' type='text/css' />
<meta content='example.tex' name='src' />
</head><body>
<!-- l. 7 --><p class='noindent'>1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
100
</p>
</body>
</html>
```
Of course executing a for loop to print a list of numbers is something that is not very TeX-like, and it would therefore be a poor choice for a programming competition. You could also assign the participants a math exercise. For this you can choose between an image format in the output, which is not suitable for automatic judging, or MathML, or MathJax.
Examples:
```
\documentclass{article}
\usepackage{pgffor}
\pagenumbering{gobble}
\begin{document}
\foreach \i in {1,...,100} {%
\i\space%
}%
$c = \sqrt{a^2+b^2}$
\end{document}
```
Terminal command for MathML:
```
make4ht example.tex "mathml"
```
Resulting html (snippet, lightly formatted for readability):
```
<!-- l. 9 --><p class='indent'> <!-- l. 9 -->
<math display='inline' xmlns='http://www.w3.org/1998/Math/MathML'>
<mrow>
<mi>c</mi> <mo class='MathClass-rel'>=</mo>
<msqrt>
<mrow><msup><mrow><mi>a</mi></mrow>
<mrow><mn>2</mn> </mrow> </msup>
<mo class='MathClass-bin'>+</mo> <msup><mrow><mi>b</mi></mrow>
<mrow><mn>2</mn></mrow></msup></mrow>
</msqrt>
</mrow>
</math>
</p>
```
Terminal command for MathJax:
```
make4ht example.tex "mathjax"
```
Html snippet:
```
<!-- l. 9 --><p class='indent'> \(c = \sqrt {a^2+b^2}\)
</p>
```
If you want to make parsing/diff-ing the file a bit easier then you can introduce one or more environments in the LaTeX file and assign a html `class` attribute to the part of the output that corresponds to that exercise. This requires a separate configuration file for TeX4ht.
`mycompetition.cfg`
```
\Preamble{xhtml}
\ConfigureEnv{assignment}
{\HCode {<div class="assignment">}}
{\HCode {</div>}} {} {}
\begin{document}
\EndPreamble
```
`example.tex`
```
\documentclass{article}
\newenvironment{assignment}{}{}
\usepackage{pgffor}
\pagenumbering{gobble}
\begin{document}
\begin{assignment}
\foreach \i in {1,...,100} {%
\i\space%
}%
\end{assignment}
\begin{assignment}
$c = \sqrt{a^2+b^2}$
\end{assignment}
\end{document}
```
Terminal command:
```
make4ht -c mycompetition.cfg example.tex "mathjax"
```
Html output snippet:
```
<!-- l. 6 --><p class='noindent'><div class='assignment'> 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
100
</div>
</p><!-- l. 12 --><p class='noindent'><div class='assignment'> \(c = \sqrt {a^2+b^2}\)
</div>
</p>
```
You could try to extend this to include for example an assignment counter as argument to the environment, see [TeX4ht : How to configure new environment with arguments?](https://tex.stackexchange.com/questions/573102/tex4ht-how-to-configure-new-environment-with-arguments) for some pointers on how to approach this.
| 8 | https://tex.stackexchange.com/users/89417 | 693544 | 321,736 |
https://tex.stackexchange.com/questions/693539 | 1 | My co-author refuses to use .bib files, preferring to have a bibliography list within one main .tex document. For example:
```
\begin{thebibliography}{99}
\bibitem{K50}
H. Kuhn, Extensive games,
Proc. Nat. Acad. Sci. 36 (1950) 286--295.
\bibitem{S53}
L. Shapley, Stochastic games,
Proc. Nat. Acad. Sci. USA 39 (1953) 1095--1100.
```
When the reference list is too long, it's a pain to check whether each source was actually cited and they will all appear in the list. I know how to do it with .bib but not sure if it's possible within one .tex document. We work in Overleaf.
Any help is appreciated.
| https://tex.stackexchange.com/users/239907 | How to find the references that are included in the reference list but not cited? | false | you could use backref. It will insert a link to the entries which are cited (be careful, to have empty lines between the entries):
```
\documentclass{article}
\usepackage[backref]{hyperref}
\begin{document}
\section{some text}
\cite{K50}
\begin{thebibliography}{99}
\bibitem{K50}
H. Kuhn, Extensive games,
Proc. Nat. Acad. Sci. 36 (1950) 286--295.
\bibitem{S53}
L. Shapley, Stochastic games,
Proc. Nat. Acad. Sci. USA 39 (1953) 1095--1100.
\end{thebibliography}
\end{document}
```
| 1 | https://tex.stackexchange.com/users/2388 | 693545 | 321,737 |
https://tex.stackexchange.com/questions/693493 | 16 | Online Judges are platforms used in competitive programming. Participants write code that solves a problem. Competitors submit their programs to the online judge, which runs all pieces of code in the grading server under the same predetermined input (if any) and environment. The judge compares the output of the programs with the correct output and determines whether the participants solved the task or not.
I was upset when I was forced to ditch my favorite language because major coding competitions did not support it. Now I am working on a project to incorporate as many languages as possible to an online judge, focusing on unpopular languages. Recently I successfully integrated \*sh and powershell. While searching for new candidates, the TeX family came to mind. It would be a fabulous addition to the group.
My plan was to compile, collate all PDF pages to a long image, OCR it then compare it with the right output. That is, `pdflatex | pdftocairo | tesseract | diff`. However I was met with numerous challenges. Since TeX writes to PDF which has a length limit, problems that require users to output a long line of text cannot be judged properly.
For example, consider a basic problem that asks contestants to simply print the numbers 1 to 100 in a line, separated by one space. Using C, one could do this:
```
$ cat ./example.c
#include <stdio.h>
int main() {
for (int i = 1; i <= 100; i++) {
printf("%d ", i);
}
return 0;
}
```
The code would be judged by this process:
```
$ gcc ./example.c -o ./example.o
$ ./example.o
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
```
This would be diffed and the online judge would rule it correct. However in LaTeX the output would inevitably span on multiple lines, resulting in a different output when ocr'd. Formatting matters in competitive programming and this cannot be deemed correct. I can't modify tesseract params to assume all output is in one line, since that would break any question that requires more than two lines of output. Giving exemptions to TeX would be unfair for other languages.
```
$ cat ./example.tex
\documentclass{article}
\usepackage{pgffor}
\pagenumbering{gobble}
\begin{document}
\foreach \i in {1,...,100} {%
\i\space%
}%
\end{document}
```
```
$ pdflatex ./example.tex
$ pdftocairo ./example.pdf -jpeg -singlefile
$ tesseract -c debug_file=/dev/null ./example.jpg -
123456789 1011 12 13 1415 1617 18 19 20 21 22 23 24 25 26 27 28
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
```
Not only does the output span over multiple lines, numbers 1 to 9 were erroneously combined into a single string by tesseract. Would there be a feasible way to adjust this procedure so that there would be a reliable automated grading system for TeX akin to other established languages that would not give it a disadvantage nor an advantage?
If this is not viable the only other way would be to make TeX output to stdout or a plaintext file like all others. Can TeX be instructed to do this?
| https://tex.stackexchange.com/users/302437 | Evaluating TeX output in competitive programming | false | **EDIT:** The following approach **doesn't work** for the intended purpose, as Pandoc will not really evaluate all of tex (unless I am missing something) and thus e.g. the `foreach` in the example does not render the numbers via Pandoc...
Unless the goal is to test fine-grained skills in Latex formatting, I think the best output format is Markdown - you can use Pandoc to do the conversion (see Example 5 at <https://pandoc.org/demos.html>). The desirable properties of markdown output is that it is
1. almost plain text, so easy to diff
2. somewhat robust to different latex coding styles - i.e. where mild changes to Latex source would create mildly different PDF or add extra <div> tags to HTML output, they could still result in exactly identical Markdown output
You'd probably want to set `--wrap=preserve` to avoid having the output wrapped to 80 char width (which is the default)
| 1 | https://tex.stackexchange.com/users/31449 | 693553 | 321,740 |
https://tex.stackexchange.com/questions/693558 | 0 | I would like to make a variant of enumerate called steps where if I do something like
```
\begin{steps}
\item This is step 1
\item This is step 2
\end{steps}
```
The output would be like
Step 1. This is step 1
Step 2. This is step 2
How would I go about something like this? What if I wanted these labels in bold or a different color.
Finally in this environment if I wanted to be able to skip a step I know for enumerate it would be \setcounter{enumi}{}, but what would it be for this?
| https://tex.stackexchange.com/users/237772 | creating a custom enumerate | true | The `enumitem` manual, section 7 already shows, how to make a `steps` environment. Here with some adaption to print the labels you want:
```
\documentclass{article}
\usepackage{enumitem}
\newlist{steps}{enumerate}{1}
\setlist[steps,1]{label=Step \arabic{*}.}
\begin{document}
\begin{steps}
\item This is step 1
\item This is step 2
\end{steps}
\end{document}
```
To setup more levels, change the last argument of `\newlist` and do additional `\setlist`. See the `enumitem` manual for more information.
BTW: `\stepcounter` has only one argument, so `\stepcounter{enumi}` is enough to jump over one step (at level 1). You don't need an extra empty group after it.
| 1 | https://tex.stackexchange.com/users/277964 | 693561 | 321,742 |
https://tex.stackexchange.com/questions/2783 | 37 | I know `\mathcal{ABC...}`, but can't bold these
| https://tex.stackexchange.com/users/nan | Bold calligraphic typeface | false | I find that `\boldsymbol` works (for both mathcal and greek letters!).
But I stumbled upon this question when it stopped working for me. Turns out the culprit was the `breqn` package; I was able to get my `\boldsymbol{\mathcal{F}}` to show up as a calligraphy F after *removing* `\usepackage{breqn}`.
```
\documentclass{article}
\usepackage{amsbsy,amsmath}
% \usepackage{breqn}
\begin{document}
$\boldsymbol{\mathcal{F}}$
\end{document}
```
| 0 | https://tex.stackexchange.com/users/207269 | 693564 | 321,745 |
https://tex.stackexchange.com/questions/693472 | 2 | I want to have an implicit grouping for each `\item` in an `itemize` or `enumerate` environment to limit typesetting effects (coloring, emphasizing) to the respective `\item`.
E.g.,
```
\begin{itemize}
\item\color{red}
Cat
\item
Dog
\begin{itemize}
```
should behave like:
```
\begin{itemize}
{\item\color{red}
Cat}
\item
Dog
\begin{itemize}
```
which would enable me to provide specialized `\item`-types:
```
\begin{itemize}
\coloritem[red]
Cat
\item
Dog
\begin{itemize}
```
where `\coloritem` is an example for a specialized `\item`-type, which could be defined as follows:
```
\let\itemaux\item
\newcommand{\coloritem}[1][blue]{\color{#1}\itemaux}
```
The supplied code changes the color of "\* Cat" to red, but is not limited to the `\coloritem`, so "\* Dog" is also displayed in red instead of in the color that was active before the `\begin{itemize}`.
| https://tex.stackexchange.com/users/33654 | Put \item into a group so that typesetting effects are limited for the list entry | false | I'd redefine `\item` to have (just inside the `citemize` environment) a further optional argument in parentheses, to specify the color.
The trick is to save the current color at the beginning of the environment.
```
\documentclass{article}
\usepackage{xcolor}
\usepackage{lipsum} % for context
\NewDocumentEnvironment{citemize}{}{%
\colorlet{current@color}{.}%
\NewCommandCopy{\latexitem}{\item}%
\RenewCommandCopy{\item}{\citem}%
\itemize
}{\enditemize}
\NewDocumentCommand{\citem}{d()o}{%
\IfNoValueTF{#1}{\color{current@color}}{\color{#1}}%
\IfNoValueTF{#2}{\latexitem}{\latexitem[#2]}%
}
\begin{document}
\color{gray!80}
\lipsum[1][1-3]
\begin{citemize}
\item(red) Cat
\item Dog
\end{citemize}
\lipsum[2][1-3]
\bigskip
\color{black}
\lipsum[1][1-3]
\begin{citemize}
\item(red) Cat
\item Dog
\end{citemize}
\lipsum[2][1-3]
\end{document}
```
I'd *not* use `itemize` for this application.
| 0 | https://tex.stackexchange.com/users/4427 | 693571 | 321,747 |
https://tex.stackexchange.com/questions/693567 | 4 | For a long time I have used the following code to put the fraction 1/2 as an exponent on the unit:
```
\documentclass{standalone}
\usepackage{siunitx}
\usepackage{xfrac}
\DeclareSIPostPower\rooted{\sfrac{1}{2}}
\begin{document}
\sfrac{1}{2} \unit{\s\rooted}
\end{document}
```
However, this no longer works and I get bunch of weird errors. This is probably because `siunitx` was changed substantially in recent times. What should I do to keep using fractions as the exponent?
Possible alternative could be to use `\textonehalf` from `textcomp`, but that does not work either.
| https://tex.stackexchange.com/users/3450 | Fraction as a power in siunitx | true | (Updated answer after realizing that `\sfrac` can be used in both text mode and math mode.)
I'd give `\unit{\second\tothe{\text{\sfrac12}}}` a try.
```
\documentclass{article} % or some other suitable document class
\usepackage{siunitx,xfrac}
\begin{document}
\unit{\second\tothe{0.5}} \quad
\unit{\second\tothe{\frac12}} \quad
\unit{\second\tothe{\text{\sfrac12}}} \quad
\unit{\second\tothe{\text{$\sfrac12$}}} \quad
\unit{\second\tothe{\text{\textonehalf}}}
\end{document}
```
| 3 | https://tex.stackexchange.com/users/5001 | 693575 | 321,751 |
https://tex.stackexchange.com/questions/693576 | 1 | I am looking for LaTeX to print a main paper with working reference/labels (including numerous references to tables and figures in the appendix), but have no printed appendix, and have the whole thing be just one .tex file.
This is a very similar to question to [this one](https://tex.stackexchange.com/questions/527487/compile-appendix-but-dont-print-it), however all the answers there involve using multiple files. The journal I'm submitting this to requires the LaTeX to be a single file.
```
\documentclass{report}
\begin{document}
\chapter{Report}
Report body.
I want to reference \ref{sec:appendix1}
\appendix
\chapter{Appendix}
Here's a really long appendix with a reference \label{sec:appendix1}.
\end{document}
```
| https://tex.stackexchange.com/users/73839 | Compile appendix in ONE file but don't print it | false |
```
\documentclass{report}
\begin{document}
\chapter{Report}
Report body.
I want to reference \ref{sec:appendix1}
\expandafter\ifx\csname r@sec:appendix1\endcsname\relax\else
\expandafter\stop
\fi
\appendix
\chapter{Appendix}
Here's a really long appendix with a reference \label{sec:appendix1}.
\end{document}
```
The first (and third) run it will typeset everything but give a warning to re-run.
The second (and fourth) run you get no warning and:
| 0 | https://tex.stackexchange.com/users/1090 | 693581 | 321,753 |
https://tex.stackexchange.com/questions/693583 | 0 | I have already asked this question: [Define an environment similar to align such that it can be used in tabularx or tabular](https://tex.stackexchange.com/questions/693382/define-an-environment-similar-to-align-such-that-it-can-be-used-in-tabularx-or-t).
Zarko's answer to that question (<https://tex.stackexchange.com/a/693393/277990>) includes an **Addendum** whose code gives exactly the output I want for situations in which there is only one group of successive statements whose '=' symbols are horizontally aligned.
I would like to allow for situations in which there is more than one such group. Please see my remarks in the following code:
```
\documentclass{article}
\usepackage{tabularx}
\begin{document}
% The code given in the Addendum to Zarko's answer:
\begin{tabularx}{250pt}{r l @{\;} >{$\raggedright}X<{$} l}
1. & \multicolumn{2}{l}{Math}
& Words \\
2. & m & = 9/3 & Words \\
3. & & = 3 & Words \\
\end{tabularx}
\vspace{1cm}
The above code is succcessful.
However, it cannot cope with situations in which
there are two or more different groups of successive statements
requiring separate horizontal alignments of = symbols.
For example, look what happens to the output if we keep going
(e.g. if we add lines 4 and 5 to the above):
\vspace{1cm}
\begin{tabularx}{250pt}{r l @{\;} >{$\raggedright}X<{$} l}
1. & \multicolumn{2}{l}{Math}
& Words \\
2. & m & = 9/3 & Words \\
3. & & = 3 & Words \\
4. & 34x+2 & = 30/2 & Words \\
5. & & = 15 & Words \\
\end{tabularx}
\vspace{1cm}
We see that the horizontal alignment of all four `=' symbols
is determined by the `=' symbol in line 4,
whereas what we want is for the `=' symbol in line 3
to be aligned with the `=' symbol in line 2
and for the `=' symbol in line 5
to be aligned with the `=' symbol in line 4.
In other words, we want to eliminate
the space between `m' and `= 9/3',
and then align the `=' symbol in line 3
directly below the `=' symbol in line 2.
\end{document}
```
| https://tex.stackexchange.com/users/277990 | Mimic align environment within tabularx, even more than once per proof | true | The second column should be right aligned (towards the =) and math so one of these:
```
\documentclass{article}
\usepackage{tabularx}
\begin{document}
The above code is succcessful.
However, it cannot cope with situations in which
there are two or more different groups of successive statements
requiring separate horizontal alignments of = symbols.
For example, look what happens to the output if we keep going
(e.g. if we add lines 4 and 5 to the above):
\vspace{1cm}
\begin{tabularx}{250pt}{r >$r<$ @{} >{\raggedright${}}X<{$} l}
1. & \multicolumn{2}{l}{Math}
& Words \\
2. & m & = 9/3 & Words \\
3. & & = 3 & Words \\
4. & 34x+2 & = 30/2 & Words \\
5. & & = 15 & Words \\
\end{tabularx}
\vspace{1cm}
\begin{tabularx}{250pt}{r >$r<$ @{} >{\raggedright${}}X<{$} l}
1. & \multicolumn{2}{l}{Math}
& Words \\
2. & m & = 9/3 & Words \\
3. & & = 3 & Words \\
\end{tabularx}
\begin{tabularx}{250pt}{r >$r<$ @{} >{\raggedright${}}X<{$} l}
4. & 34x+2 & = 30/2 & Words \\
5. & & = 15 & Words \\
\end{tabularx}
\vspace{1cm}
We see that the horizontal alignment of all four `=' symbols
is determined by the `=' symbol in line 4,
whereas what we want is for the `=' symbol in line 3
to be aligned with the `=' symbol in line 2
and for the `=' symbol in line 5
to be aligned with the `=' symbol in line 4.
In other words, we want to eliminate
the space between `m' and `= 9/3',
and then align the `=' symbol in line 3
directly below the `=' symbol in line 2.
\end{document}
```
| 2 | https://tex.stackexchange.com/users/1090 | 693585 | 321,754 |
https://tex.stackexchange.com/questions/693576 | 1 | I am looking for LaTeX to print a main paper with working reference/labels (including numerous references to tables and figures in the appendix), but have no printed appendix, and have the whole thing be just one .tex file.
This is a very similar to question to [this one](https://tex.stackexchange.com/questions/527487/compile-appendix-but-dont-print-it), however all the answers there involve using multiple files. The journal I'm submitting this to requires the LaTeX to be a single file.
```
\documentclass{report}
\begin{document}
\chapter{Report}
Report body.
I want to reference \ref{sec:appendix1}
\appendix
\chapter{Appendix}
Here's a really long appendix with a reference \label{sec:appendix1}.
\end{document}
```
| https://tex.stackexchange.com/users/73839 | Compile appendix in ONE file but don't print it | false | This uses three files with `\include` and `\includeonly`. The master file controls which file(s) get printed. The version shown prints both and is used to set up the aux file (references).
```
\documentclass{report}
\includeonly{body,appendix}
\begin{document}
\include{body}
\include{appendix}
\end{document}
```
body.tex:
```
\chapter{Report}
Report body.
I want to reference \ref{sec:appendix1}
```
appendix.tex:
```
\appendix
\chapter{Appendix}
Here's a really long appendix with a reference \label{sec:appendix1}.
```
To print only one file at a time, remove the other from `\includeonly`. Note that `\include` will force a new page, so should go before `\chapter` or `\appendix` instead of after.
| 0 | https://tex.stackexchange.com/users/34505 | 693592 | 321,758 |
https://tex.stackexchange.com/questions/693582 | 2 | I am using power to 1/2 in `siunitx`:
```
\documentclass{standalone}
\usepackage[per-mode = symbol-or-fraction]{siunitx}
\usepackage{xfrac}
\begin{document}
\unit{\second\tothe{\text{\sfrac12}}}
\unit{\meter\per\second\tothe{\text{\sfrac12}}}
\end{document}
```
It works fine when `\per` is not used. However, with `\per` I get strange errors:
```
<argument> \???
! LaTeX Error: Erroneous variable \protect used!
l.XX ...{\meter\per\second\tothe{\text{\sfrac12}}}
```
It seems that there is some bug in `siunitx`. Anyone has any idea how to solve this problem?
| https://tex.stackexchange.com/users/3450 | Bug in siunitx? | true | By using `\tothe{\sfrac{1}{2}}` you are relying on `siunitx` printing the power with no mathematical intervention: the unit is handled in 'parsed' mode as everything 'looks' parsable (there are no out-and-out literals). However, once you add `\per`, in parsed mode `siunitx` needs to do maths with the exponent. That fails as `\sfrac{1}{2}` is not a number.
What you should be doing here is helping out `siunitx` using `parse-units = false`: that forces literal printing, and no inversion of the fraction is attempted.
---
I will think a bit about whether this should *always* be an error. I have in the past toyed with conversion of fractions in exponents, but it looks quite a lot of code and not 100% reliable. I will though look at this again: I'll log some issues.
| 3 | https://tex.stackexchange.com/users/73 | 693608 | 321,764 |
https://tex.stackexchange.com/questions/693600 | 4 | I'm writing a handbook for my students and I want to create a command which should draw a task definition, its type and possible features, like source and link to the solution on YouTube.
In my plan all of these definitions should work (of course I use pseudo syntax here on purpose, just to show you my intention):
* `\task{definition=$x=3$}`
* `\task{definition=$x=3$, source='ABC'}`
* `\task{definition=$x=3$, link='https://youtube.ru'}`
* `\task{definition=$x=3$, source='ABC', link='https://youtube.ru'}`
But I cannot find any tool similar to optional and named arguments.
| https://tex.stackexchange.com/users/302499 | Is there a way to add optional and/or named argument to command | false | This might be a start using `keyval`
```
\documentclass{article}
\usepackage{keyval}
\makeatletter
\newcommand*{\task@definition}{}
\newcommand*{\task@source}{}
\newcommand*{\task@link}{}
\define@key{task}{definition}{\def\task@definition{#1}}
\define@key{task}{source}{\def\task@source{#1}}
\define@key{task}{link}{\def\task@link{#1}}
\newcommand*{\task}[1]{%
\begingroup
\setkeys{task}{#1}%
This is a task with definition \task@definition.%
\ifx\task@source\@empty\else\space You can find its source in \task@source.\fi
\ifx\task@link\@empty\else\space (See \task@link)\fi
\endgroup
}
\makeatother
\begin{document}
\parindent0pt
\task{definition={$x=3$}}\par % you must "hide" the =
\task{definition={$x=3$}, source=ABC}\par
\task{definition={$x=3$}, link=https://youtube.ru}\par
\task{definition={$x=3$}, source=ABC, link=https://youtube.ru}
\task{definition={$x=3$}} % you must "hide" the =
\end{document}
```
| 4 | https://tex.stackexchange.com/users/82917 | 693613 | 321,767 |
https://tex.stackexchange.com/questions/693600 | 4 | I'm writing a handbook for my students and I want to create a command which should draw a task definition, its type and possible features, like source and link to the solution on YouTube.
In my plan all of these definitions should work (of course I use pseudo syntax here on purpose, just to show you my intention):
* `\task{definition=$x=3$}`
* `\task{definition=$x=3$, source='ABC'}`
* `\task{definition=$x=3$, link='https://youtube.ru'}`
* `\task{definition=$x=3$, source='ABC', link='https://youtube.ru'}`
But I cannot find any tool similar to optional and named arguments.
| https://tex.stackexchange.com/users/302499 | Is there a way to add optional and/or named argument to command | true | Classically the LaTeX2e solution was the `keyval` package (as used by `\includegraphics[height=2cm, scale=3]{...}`) but recent LaTeX releases include a keyval parser built in, based on `l3keys`.
@Campa's example modified to use the newer system:
```
\documentclass{article}
\makeatletter
\DeclareKeys[task]{
definition .store = \task@definition,
source .store = \task@source,
link .store = \task@link
}
\NewDocumentCommand\task{m}{%
\begingroup
\SetKeys[task]{#1}%
This is a task with definition \task@definition.%
\ifx\task@source\@empty\else\space You can find its source in \task@source.\fi
\ifx\task@link\@empty\else\space (See \task@link)\fi
\endgroup
}
\makeatother
\begin{document}
\parindent0pt
\task{definition={$x=3$}}\par % you must "hide" the =
\task{definition={$x=3$}, source=ABC}\par
\task{definition={$x=3$}, link=https://youtube.ru}\par
\task{definition={$x=3$}, source=ABC, link=https://youtube.ru}
\task{definition={$x=3$}} % you must "hide" the =
\end{document}
```
| 10 | https://tex.stackexchange.com/users/1090 | 693619 | 321,772 |
https://tex.stackexchange.com/questions/20140 | 76 | In a normal table, you can use the `\hline` command to draw a horizontal line. I am trying to make this line a dashed horizontal line.
I have found the package `dashrule` [via this answer](https://tex.stackexchange.com/questions/12537/how-can-i-make-a-horizontal-dashed-line), but this only works for `\rule` situations; i.e. it can't be directly used as a line in a table, and LaTeX won't compile it. Conversely, I've tried wrapping the `\hdashrule` in a multicolumn:
```
\multicolumn{5}{|c|}{\hdashrule{130mm}{1pt}{4pt}} \
```
However, the padding around the table cell breaks the flow of the table, and the horizontal rule is not aligned with the other `\hline`s of the table. (It also means that the rule width must be specified manually.)
Is there any way to make a `\hline` dashed without resorting to tables-in-tables? Can you force a single table cell to have no vertical or horizontal margins and padding?
| https://tex.stackexchange.com/users/2206 | Can a table include a horizontal dashed line? | false | With the package `nicematrix`, you can create tools which will draw rules in your environment `{NiceTabular}` (of `nicematrix`) with Tikz: all the styles of Tikz may be used...
```
\documentclass{article}
\usepackage{nicematrix,tikz}
\NiceMatrixOptions
{
custom-line =
{
letter = : ,
command = dashedline ,
ccommand = cdashedline ,
tikz = dashed
}
}
\begin{document}
\renewcommand{\arraystretch}{1.4}
\begin{NiceTabular}{c:cc}
column1a & column2a & column3a \\
column1b & column2b & column3b \\
\dashedline
column1c & column2c & column3c \\
\cdashedline{1-2}
column1d & column2d & column3d \\
\end{NiceTabular}
\end{document}
```
| 1 | https://tex.stackexchange.com/users/163000 | 693626 | 321,777 |
https://tex.stackexchange.com/questions/224010 | 6 | I use Texmaker to edit my tex documents and I have the PDF viewer embedded in the editor, so I can edit the .tex files in the left and see the PDF result in the right. For big documents, a quite common Texmaker feature I use is "click to jump to the line" [Ctrl+click], that allows me to click somewhere in the PDF and it will direct to the specific line in the .tex file.
However, from time to time, this feature doesn't get updated with the PDF and redirects me to different (not far) parts of the document. I haven't been able to isolate the reason if it happening. I was wondering if this is just a bug or if there is an specific reason for this to happen (e.g. corrupt aux file?).
I am running Texmaker 4.2 (compiled with Qt 5.2.1 and Poppler 0.22.5) in a Windows 8 x64 machine.
| https://tex.stackexchange.com/users/21309 | Texmaker "click to jump to the line" does not always update in PDF viewer | false | I discovered that I had this problem due to the fact that my folder was in OneDrive. Once I pulled it out of there, everything fell into place. But this works only if your file does not consist of many files.
| 1 | https://tex.stackexchange.com/users/148679 | 693637 | 321,781 |
https://tex.stackexchange.com/questions/693639 | 0 | I'm using ModernCV to create my CV and I've spent a long time playing around with link styles. I find coloured links to stand out too much or clash with other colours on the page, and the standard underline to be too strong, especially under headings or bold text.
The solution I've landed on is to underline all links with a `lightgray` underline. This is just subtle enough and works well throughout the document.
I understand the default solution is supposed to be to configure the outline settings in the `hypersetup`, but I have never got this to work. If I set `pdfborder` to anything other than `0 0 0` I'll always get horrible boxes around links that I can't configure.
The main package I've found that allows you to control the colour of underlines is [soul](https://ctan.org/pkg/soul?lang=en), with the `\setulcolor` command to customise soul's custom `\ul` command. The main problem I had with that was that whenever I tried to use that in conjunction with a hyperlink I got an error about too many `}`s that I couldn't explain.
How can I successfully set the link underline to `lightgray`?
| https://tex.stackexchange.com/users/302527 | How to add a coloured underline to all links | true | The solution I found is customised from [this lifesaver of an answer](https://tex.stackexchange.com/a/311136/302527), using `hyperref` and `soul` together to replace the old `href` function.
The solution provided there actually gave me the error "Package soul Error: Reconstruction failed", but [this answer](https://tex.stackexchange.com/a/413338/302527) told me I just needed to add an `\mbox`.
So, here's how to make all links underlined with a `lightgray` underline:
```
\usepackage{hyperref,xcolor, soul}
\setulcolor{lightgray}
\let\oldhref\href
\renewcommand{\href}[2]{\oldhref{#1}{\hrefstyle{#2}}}
\newcommand{\hrefstyle}[1]{\ul{\mbox{#1}}}
```
Which results in nice subtle links looking like this:
| 0 | https://tex.stackexchange.com/users/302527 | 693640 | 321,782 |
https://tex.stackexchange.com/questions/693635 | 0 | Is translating old research paper in Math, Physics or CS (which are not written in the modern LaTex form but old font using typewriters which do not look good or appealing to the eyes and are not easily readable) to latex a good way to learn LaTex?
For example here is an old paper by Leslie Valiant titiled [The complexity of enumeration and reliability problems](https://www.math.cmu.edu/%7Eaf1p/Teaching/MCC17/Papers/enumerate.pdf). I am trying to convert it to latex file and then produce its pdf. Similarly other old papers from the time when Latex( say early 20th centurey ) was not available can also be rewritten in LaTex. Is it a good practice to enhence LaTex skills?
| https://tex.stackexchange.com/users/302526 | Learning Latex by converting old research papers to Latex | true | My first thought: probably the most painful way to approach LaTeX.
Second thought: why not?
Third: why not going over such papers, identify interesting parts and reproducing them in LaTeX? I.e. focus on parts, not the whole paper, at least in the beginning.
Let's illustrate the third thought.
### Layout, 1st page
An almost no-brainer is adding a title, the author and the abstract-environment. With `\usepackage{blindtext}` you can mimic the structure of the content (1. Introduction, 2. Preliminaries etc.)
For the header you need to have indication, that there's a package waiting for you: `fancyhdr`. And in almost no time you've mimicked 80 % or more of the first page.
What did you learn? Well the standard and its extensions via packages.
### Page 2: all the math inside
That's a good exercise to try the standard implementation of the math environment. I.e. here you probably won't have the need to have a look at `amsmath` etc.
### Same page: more environments
Right, that is, or should be, an environment, as it's used more than once. So, either time to find an existing one, or to spend some time on your new friend, the `\newenvironment` statement.
It's also a good idea to identify other repeating patterns, like "TM" here, and may be put them into a macro `\newcommand`: that improves consistency and makes changes easy.
### And so on
It will probably be a good idea to do several things in parallel while you're learning, e.g.:
* read a good book introducing LaTeX, like on [wikibooks](https://en.wikibooks.org/wiki/LaTeX)
* try the codes you read there, i.e. write and compile simple documents
* try identifying what you read in the research papers you mentioned
* if you don't find it now, leave it for later: it will become more self-evident (or have a search here)
* do what I lined out above, i.e. replicate parts which are relevant from a LaTeX point of view, like `\section`, `\newcommand`, lists etc.
Not to forget: many times there is more than one way to let LaTeX do the typesetting. After some time you'll know which solution came first (and might have had problems, or are still useful), why certain extensions were made (some are very versatile, others are trading trouble for problems).
BTW, a nice search term for google is:
* ctan //your keywords//
e.g. [ctan header](https://www.google.com/search?q=ctan%20header) leads you quickly to `fancyhdr`.
| 3 | https://tex.stackexchange.com/users/245790 | 693641 | 321,783 |
https://tex.stackexchange.com/questions/693643 | 2 | With the latest update of `memoir` (v.3.8) I detect an error if I also load `csquotes` and defines active quotes in the following way:
```
\documentclass{memoir}
\usepackage{csquotes}
\MakeBlockQuote{<}{|}{>}
\begin{document}
Test
\end{document}
```
LaTeX crashes with the following error:
>
> ! LaTeX hooks Error: Generic hooks cannot be added
> to '@xfloat'.
>
>
>
Can anyone help me? Thank you
| https://tex.stackexchange.com/users/287680 | Problem with 'memoir' v3.8 and 'csquotes' | true | It is not really `memoir` related. The Hook code in the kernel has issues with active chars ( `\MakeBlockQuote{<}{|}{>}` makes `>` active).
Here is a simple example that Ulrike provided elsewhere
```
\documentclass{article}
\def\test#1{?}
\AddToHook{cmd/test/after}{xx}
\catcode`\?=13
\begin{document}
Test
\end{document}
```
As Ulrike mentioned in a comment, move
```
\MakeBlockQuote{<}{|}{>}
\EnableQuotes
```
after `\begin{document}`. But in general it is a good idea to avoid making `<` and `>` active as that can cause strange results.
Apparently the Hook code does not like if the catcodes of the patch/hook was not matching the catcodes of the original definition.
The issue has been logged here: <https://github.com/latex3/latex2e/issues/1099>
| 5 | https://tex.stackexchange.com/users/3929 | 693646 | 321,785 |
https://tex.stackexchange.com/questions/81930 | 6 | I am working in a minipage, because I want two columns next to each other in landscape mode.
In the first column I would like to place a figure, and then a tabular. I am scaling the tabular to exactly fit the minipage. This is roughly the outline:
```
\newpage
\begin{minipage}{0.50\textwidth}
\begin{center}
\resizebox{\columnwidth}{!}{%
% latex table generated in R 2.14.1 by xtable 1.6-0 package
% Thu Nov 8 13:31:32 2012
\begin{tabular}
...
\end{tabular}%
}
\end{center}
\end{minipage}
\begin{minipage}{0.50\textwidth}
\end{minipage}
```
What I now would like to do is plot the remaining figure in exactly the correct proportions to fill the remainder of the page - the width is fairly easy, but what is the height? The problem is also that I don't know the number of rows of the table in advance.
So I need some way to determine the height of the tabular, subtract it from the textheight, to obtain my remaining space for the figure.
`\settoheight` unfortunately only works on text.
| https://tex.stackexchange.com/users/21912 | Determine height of tabular | false | Another approach using `calc`'s package `\totalheightof` (compute sum of height and depth):
```
\usepackage{calc}
...
\DeclareRobustCommand*{\mytable}{
\begin{tabular}{...}
[YOUR TABLE]
\end{tabular}
}
...
\begin{document}
...
\newlength{\mytableheigth}
\setlength{\mytableheigth}{\totalheightof{\mytable}}
```
| 0 | https://tex.stackexchange.com/users/74382 | 693650 | 321,788 |
https://tex.stackexchange.com/questions/693293 | 0 | I'm writing a latex/PDF book with [R/bookdown](https://bookdown.org/). I'm trying to include, in the bibliography, a list of the pages that each article was cited in (i.e., backrefs). However, the `backref` and `pagebackref` options of the `hyperref` latex package are not working for me for the PDF output.
Here's the code I include in the preamble to try to include backrefs:
```
\usepackage[pagebackref=true]{hyperref}
```
However, this does not create a list of "pages cited in" next to the articles in my bibliography. I am using the [`apa.csl`](https://www.zotero.org/styles/apa) Citation Style Language and the `krantz2` document class ([`krantz.cls`](https://github.com/yihui/bookdown-crc/blob/master/krantz.cls)).
Here are the contents of the `.tex` file that is generated:
```
% Options for packages loaded elsewhere
\PassOptionsToPackage{unicode}{hyperref}
\PassOptionsToPackage{hyphens}{url}
%
\documentclass[
krantz2]{krantz}
\usepackage{amsmath,amssymb}
\usepackage{lmodern}
\usepackage{iftex}
\ifPDFTeX
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{textcomp} % provide euro and other symbols
\else % if luatex or xetex
\usepackage{unicode-math}
\defaultfontfeatures{Scale=MatchLowercase}
\defaultfontfeatures[\rmfamily]{Ligatures=TeX,Scale=1}
\fi
% Use upquote if available, for straight quotes in verbatim environments
\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
\IfFileExists{microtype.sty}{% use microtype if available
\usepackage[]{microtype}
\UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
}{}
\makeatletter
\@ifundefined{KOMAClassName}{% if non-KOMA class
\IfFileExists{parskip.sty}{%
\usepackage{parskip}
}{% else
\setlength{\parindent}{0pt}
\setlength{\parskip}{6pt plus 2pt minus 1pt}}
}{% if KOMA class
\KOMAoptions{parskip=half}}
\makeatother
\usepackage{xcolor}
\usepackage{longtable,booktabs,array}
\usepackage{calc} % for calculating minipage widths
% Correct order of tables after \paragraph or \subparagraph
\usepackage{etoolbox}
\makeatletter
\patchcmd\longtable{\par}{\if@noskipsec\mbox{}\fi\par}{}{}
\makeatother
% Allow footnotes in longtable head/foot
\IfFileExists{footnotehyper.sty}{\usepackage{footnotehyper}}{\usepackage{footnote}}
\makesavenoteenv{longtable}
\setlength{\emergencystretch}{3em} % prevent overfull lines
\providecommand{\tightlist}{%
\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
\setcounter{secnumdepth}{5}
\newlength{\cslhangindent}
\setlength{\cslhangindent}{1.5em}
\newlength{\csllabelwidth}
\setlength{\csllabelwidth}{3em}
\newlength{\cslentryspacingunit} % times entry-spacing
\setlength{\cslentryspacingunit}{\parskip}
\newenvironment{CSLReferences}[2] % #1 hanging-ident, #2 entry spacing
{% don't indent paragraphs
\setlength{\parindent}{0pt}
% turn on hanging indent if param 1 is 1
\ifodd #1
\let\oldpar\par
\def\par{\hangindent=\cslhangindent\oldpar}
\fi
% set entry spacing
\setlength{\parskip}{#2\cslentryspacingunit}
}%
{}
\usepackage{calc}
\newcommand{\CSLBlock}[1]{#1\hfill\break}
\newcommand{\CSLLeftMargin}[1]{\parbox[t]{\csllabelwidth}{#1}}
\newcommand{\CSLRightInline}[1]{\parbox[t]{\linewidth - \csllabelwidth}{#1}\break}
\newcommand{\CSLIndent}[1]{\hspace{\cslhangindent}#1}
\usepackage{booktabs}
\usepackage{longtable}
\usepackage[bf,singlelinecheck=off]{caption}
\captionsetup[table]{labelsep=space}
\captionsetup[figure]{labelsep=space}
\usepackage[scale=.8]{sourcecodepro}
\usepackage{framed,color}
\definecolor{shadecolor}{RGB}{248,248,248}
\renewcommand{\textfraction}{0.05}
\renewcommand{\topfraction}{0.8}
\renewcommand{\bottomfraction}{0.8}
\renewcommand{\floatpagefraction}{0.75}
\renewenvironment{quote}{\begin{VF}}{\end{VF}}
\usepackage[pagebackref=true]{hyperref}
\let\oldhref\href
\renewcommand{\href}[2]{#2\footnote{\url{#1}}}
\makeatletter
\newenvironment{kframe}{%
\medskip{}
\setlength{\fboxsep}{.8em}
\def\at@end@of@kframe{}%
\ifinner\ifhmode%
\def\at@end@of@kframe{\end{minipage}}%
\begin{minipage}{\columnwidth}%
\fi\fi%
\def\FrameCommand##1{\hskip\@totalleftmargin \hskip-\fboxsep
\colorbox{shadecolor}{##1}\hskip-\fboxsep
% There is no \\@totalrightmargin, so:
\hskip-\linewidth \hskip-\@totalleftmargin \hskip\columnwidth}%
\MakeFramed {\advance\hsize-\width
\@totalleftmargin\z@ \linewidth\hsize
\@setminipage}}%
{\par\unskip\endMakeFramed%
\at@end@of@kframe}
\makeatother
\makeatletter
\@ifundefined{Shaded}{
}{\renewenvironment{Shaded}{\begin{kframe}}{\end{kframe}}}
\makeatother
\usepackage{makeidx}
\makeindex
% to create a "see also" that appears at the bottom of the
% subentries and with no page number, do the following:
% \index{Main entry!zzzzz@\igobble|seealso{Other item}}
\newcommand{\ii}[1]{{\it #1}}
\newcommand{\nn}[1]{#1n}
\def\igobble#1{}
\urlstyle{tt}
\usepackage{amsthm}
\makeatletter
\def\thm@space@setup{%
\thm@preskip=8pt plus 2pt minus 4pt
\thm@postskip=\thm@preskip
}
\makeatother
\frontmatter
\ifLuaTeX
\usepackage{selnolig} % disable illegal ligatures
\fi
\IfFileExists{bookmark.sty}{\usepackage{bookmark}}{\usepackage{hyperref}}
\IfFileExists{xurl.sty}{\usepackage{xurl}}{} % add URL line breaks if available
\urlstyle{same} % disable monospaced font for URLs
\hypersetup{
pdftitle={Book Title},
pdfauthor={Author Name},
hidelinks,
pdfcreator={LaTeX via pandoc}}
\title{Book Title}
\author{Author Name}
\date{2023-08-16}
\begin{document}
\maketitle
\thispagestyle{empty}
\begin{center}
INSERT DEDICATION
\end{center}
\setlength{\abovedisplayskip}{-5pt}
\setlength{\abovedisplayshortskip}{-5pt}
{
\setcounter{tocdepth}{1}
\tableofcontents
}
\hypertarget{preface}{%
\chapter*{Preface}\label{preface}}
INSERT TEXT HERE (Xie, 2022).
\hypertarget{references}{%
\chapter*{References}\label{references}}
\hypertarget{refs}{}
\begin{CSLReferences}{1}{0}
\leavevmode\vadjust pre{\hypertarget{ref-R-bookdown}{}}%
Xie, Y. (2022). \emph{{bookdown}: Authoring books and technical documents with {R} {Markdown}}. \url{https://CRAN.R-project.org/package=bookdown}
\end{CSLReferences}
\backmatter
\printindex
\end{document}
```
Here is the minimal reproducible example (along with [`apa.csl`](https://www.zotero.org/styles/apa) and [`krantz.cls`](https://github.com/yihui/bookdown-crc/blob/master/krantz.cls)—I'm not sure how to make those two files "minimal") that generates the above `.tex` file:
`index.rmd`:
```
---
title: "Book Title"
author: "Author Name"
date: "`r Sys.Date()`"
documentclass: krantz
classoption: krantz2
bibliography: [book.bib]
site: bookdown::bookdown_site
---
```
`01-Preface.rmd`:
```
# Preface {-}
INSERT TEXT HERE [@R-bookdown].
```
`preamble.tex`:
```
\usepackage{booktabs}
\usepackage{longtable}
\usepackage[bf,singlelinecheck=off]{caption}
\captionsetup[table]{labelsep=space}
\captionsetup[figure]{labelsep=space}
\usepackage[scale=.8]{sourcecodepro}
\usepackage{framed,color}
\definecolor{shadecolor}{RGB}{248,248,248}
\renewcommand{\textfraction}{0.05}
\renewcommand{\topfraction}{0.8}
\renewcommand{\bottomfraction}{0.8}
\renewcommand{\floatpagefraction}{0.75}
\renewenvironment{quote}{\begin{VF}}{\end{VF}}
\usepackage[pagebackref=true]{hyperref}
\let\oldhref\href
\renewcommand{\href}[2]{#2\footnote{\url{#1}}}
\makeatletter
\newenvironment{kframe}{%
\medskip{}
\setlength{\fboxsep}{.8em}
\def\at@end@of@kframe{}%
\ifinner\ifhmode%
\def\at@end@of@kframe{\end{minipage}}%
\begin{minipage}{\columnwidth}%
\fi\fi%
\def\FrameCommand##1{\hskip\@totalleftmargin \hskip-\fboxsep
\colorbox{shadecolor}{##1}\hskip-\fboxsep
% There is no \\@totalrightmargin, so:
\hskip-\linewidth \hskip-\@totalleftmargin \hskip\columnwidth}%
\MakeFramed {\advance\hsize-\width
\@totalleftmargin\z@ \linewidth\hsize
\@setminipage}}%
{\par\unskip\endMakeFramed%
\at@end@of@kframe}
\makeatother
\makeatletter
\@ifundefined{Shaded}{
}{\renewenvironment{Shaded}{\begin{kframe}}{\end{kframe}}}
\makeatother
\usepackage{makeidx}
\makeindex
\newcommand{\ii}[1]{{\it #1}}
\newcommand{\nn}[1]{#1n}
\def\igobble#1{}
\urlstyle{tt}
\usepackage{amsthm}
\makeatletter
\def\thm@space@setup{%
\thm@preskip=8pt plus 2pt minus 4pt
\thm@postskip=\thm@preskip
}
\makeatother
\frontmatter
```
`after_body.tex`:
```
\backmatter
\printindex
```
`book.bib`:
```
@Manual{R-bookdown,
title = {{bookdown}: Authoring books and technical documents with {R} {Markdown}},
author = {Yihui Xie},
note = {R package version 0.26},
year = {2022},
url = {https://CRAN.R-project.org/package=bookdown},
}
```
`_output.yml`:
```
bookdown::pdf_book:
includes:
in_header: latex/preamble.tex
after_body: latex/after_body.tex
keep_tex: true
dev: "cairo_pdf"
latex_engine: xelatex
citation_package: none
template: null
pandoc_args: [ "--csl", "apa.csl", "--top-level-division=chapter" ]
toc_depth: 2
toc_unnumbered: false
toc_appendix: true
quote_footer: ["\\VA{", "}{}"]
highlight_bw: true
```
If you want to see the full, working reproducible example, see here:
<https://github.com/isaactpetersen/mre>
You can see the output pdf of the minimal reproducible example in the GitHub Actions workflow of the repo (click on the most recent workflow run and click `_book` to download the artifact that includes the PDF):
<https://github.com/isaactpetersen/mre/actions>
| https://tex.stackexchange.com/users/35243 | Backrefs not working when creating a pdf using bookdown/latex | false | So here's my answer. But, as said in the comments multiple times, your code and the workflow is too long to run all commands and debbug the output by myself.
As your using a `csl` style with pandoc there will be no `bibitems` produced which `hyperref` could use as ref point. I would recommend to run pandoc without `citeproc` and use `biblatex` option instead to output a `tex` file. Something like `pandoc <your input file> -t latex --biblatex -o xyz.tex` with the fitting files and additional arguments.
Then you can set the correct `biblatex` options, like `style=apa`, `backref` etc. and compile the `tex` file using `xelatex` and `biber`.
**Attention**: As mentioned I didn't test it for R-markdown compatibility and output due to your extensive file contents and complex workflow.
| 1 | https://tex.stackexchange.com/users/297560 | 693654 | 321,790 |
https://tex.stackexchange.com/questions/593907 | 2 | I'm taking a beating from biblatex's punctuation tracker, and thought I'd better ask for some assistance.
I'm trying to create a macro which is meant to be used as a general flag that I have translated a certain quotation. The natural place for this would be the citation postnote, but I wouldn't want to overdo it, and I think it is enough to do it every chapter, or section.
So, I came up with the following macro:
```
\newcounter{mytranslationcount}[section]
\newrobustcmd*{\mytranslation}{%
\ifnum\value{mytranslationcount}=0
\addcomma\addspace\printtext{my translation, as will be all following ones
in a foreign language}%
\stepcounter{mytranslationcount}%
\fi}
```
It mostly works, but not quite. It does print the intended text when it should. However, it messes with `biblatex`'s punctuation tracker, and this results in undesired output when the macro prints nothing, and there is nothing else in the postnote. In this case, the printing of the postnote, which from biblatex's point of view is not empty, triggers the punctuation tracker and we get a comma. And, as nothing else comes after it, we also lose the final period (in the case of a footnote).
A MWE:
```
\documentclass{article}
\usepackage[style=authoryear,autocite=footnote]{biblatex}
\addbibresource{biblatex-examples.bib}
\newcounter{mytranslationcount}[section]
\newrobustcmd*{\mytranslation}{%
\ifnum\value{mytranslationcount}=0
\addcomma\addspace\printtext{my translation, as will be all following ones
in a foreign language}%
\stepcounter{mytranslationcount}%
\fi}
\begin{document}
\section{Section 1}
% Looks good.
\autocite[\pnfmt{3333-3345}\mytranslation]{sigfridsson}
% Also good.
\autocite[\pnfmt{3333-3345}\mytranslation]{sigfridsson}
\section{Section 2}
% Still good.
\autocite[\mytranslation]{sigfridsson}
% This is the offending one. When there is nothing else in the postnote and
% \mytranslation prints nothing, biblatex has already called in the postnote
% punctuation from the tracker, so that we get an unwanted comma and lose an
% wanted period.
\autocite[\mytranslation]{sigfridsson}
\end{document}
```
I was hoping for one such macro I could use like this in the postnote, for the semantic value of doing it this way. Given this hope, I haven't yet tried to resort to `\AtNextCite(key)`, or to tampering with the `postnote` macro directly, but I'm all ears...
| https://tex.stackexchange.com/users/105447 | Conditionally print something in a biblatex postnote (punctuation issue) | false | I'm revisiting this problem, and I've never been completely happy with the alternatives. But, that given, perhaps this is the best place to keep track of them. So, I leave below possible working alternatives, each with their caveats.
First, testing the content of `postnote`:
```
\documentclass{article}
\usepackage[style=authoryear,autocite=footnote]{biblatex}
\addbibresource{biblatex-examples.bib}
\newcounter{mytranslationcount}[section]
\NewDocumentCommand{\mytranslation}{}{%
\ifnumequal{\value{mytranslationcount}}{0}
{%
\addcomma\addspace\printtext{my translation, as will be all
following ones in a foreign language}%
\stepcounter{mytranslationcount}%
}
{}%
}
\AtEveryCitekey{%
\ifboolexpr
{ ( ( test { \iffieldequalstr{postnote}{\mytranslation} }
or
test { \iffieldequalstr{postnote}{\mytranslation{}} } )
and not
test {\ifnumequal{\value{mytranslationcount}}{0}} ) }
{\clearfield{postnote}}
{}%
}
\begin{document}
\section{Section 1}
% Looks good.
\autocite[\pnfmt{3333-3345}\mytranslation{}]{sigfridsson}
% Also good.
\autocite[\pnfmt{3333-3345}\mytranslation]{sigfridsson}
\section{Section 2}
% Still good.
\autocite[\mytranslation{}]{sigfridsson}
% OK.
\autocite[\mytranslation{}]{sigfridsson}
\end{document}
```
Second, making `\mytranslation` a flag (to be used outside of the citation):
```
\documentclass{article}
\usepackage[style=authoryear,autocite=footnote]{biblatex}
\addbibresource{biblatex-examples.bib}
\newcounter{mytranslationcount}[section]
\newboolean{mytranslationbool}
\usepackage{xpatch}
\newcommand*{\mytranslation}{%
\AtNextCitekey{\booltrue{mytranslationbool}}}
\xapptobibmacro{postnote}{%
\ifboolexpr{ (
test {\ifbool{mytranslationbool}}
and
test {\ifnumequal{\value{mytranslationcount}}{0}}
) }
{\addcomma\addspace\printtext{my translation, as will be all
following ones in a foreign language}%
\stepcounter{mytranslationcount}}
{}}{}{}
\begin{document}
\section{Section 1}
% Looks good.
\mytranslation\autocite[\pnfmt{3333-3345}]{sigfridsson}
% Also good.
\mytranslation\autocite[\pnfmt{3333-3345}]{sigfridsson}
\section{Section 2}
% Still good.
\mytranslation\autocite{sigfridsson}
% OK.
\mytranslation\autocite{sigfridsson}
\end{document}
```
Third, a variant using the measuring technique from [@moewe's answer](https://tex.stackexchange.com/a/593935/105447):
```
\documentclass{article}
\usepackage[style=authoryear,autocite=footnote]{biblatex}
\addbibresource{biblatex-examples.bib}
\newcounter{mytranslationcount}[section]
\newboolean{mytranslationbool}
\newrobustcmd*{\mytranslation}{%
\ifnumequal{\value{mytranslationcount}}{0}{%
\addcomma\addspace\printtext{my translation, as will be all
following ones in a foreign language}%
\ifbool{mytranslationbool}{\stepcounter{mytranslationcount}}{}}{}}
% Width measurement technique by egreg at:
% https://tex.stackexchange.com/a/53091
\def\foreverunspace{%
\ifnum\lastnodetype=11
\unskip\foreverunspace
\else
\ifnum\lastnodetype=12
\unkern\foreverunspace
\else
\ifnum\lastnodetype=13
\unpenalty\foreverunspace
\fi
\fi
\fi
}
% Clear the postnote field if its width is zero. But the measurement expands
% it, thus we have to protect the counter step in '\mytranslation' behind
% 'mytranslationbool', which we toggle true after measuring.
\AtEveryCitekey{%
\iffieldundef{postnote}{}{%
\setbox0=\hbox{\thefield{postnote}\foreverunspace}%
\ifdim\wd0=0pt
\clearfield{postnote}
\fi
\booltrue{mytranslationbool}%
}%
}
\begin{document}
\section{Section 1}
% Looks good.
\autocite[\pnfmt{3333-3345}\mytranslation{}]{sigfridsson}
% Also good.
\autocite[\pnfmt{3333-3345}\mytranslation]{sigfridsson}
\section{Section 2}
% Still good.
\autocite[\mytranslation{}]{sigfridsson}
% OK.
\autocite[\mytranslation{}]{sigfridsson}
\end{document}
```
And a fourth:
```
\documentclass{article}
\usepackage[style=authoryear,autocite=footnote]{biblatex}
\addbibresource{biblatex-examples.bib}
\ExplSyntaxOn
\newcounter{mytranslationcount}[section]
\NewDocumentCommand{\mytranslation}{}
{
\int_compare:nNnT { \value { mytranslationcount } } = { 0 }
{
\addcomma\addspace\printtext{my~translation,~as~will~be~all~
following~ones~in~a~foreign~language}
\stepcounter{mytranslationcount}
}
}
\AtEveryCitekey
{
\tl_set:Nn \l_tmpa_tl { \mytranslation }
\tl_set:Nn \l_tmpb_tl { \mytranslation{} }
\iffieldundef { postnote }
{ }
{
\bool_lazy_and:nnT
{ \int_compare_p:nNn { \value { mytranslationcount } } > { 0 } }
{
\tl_if_eq_p:Nc \l_tmpa_tl { abx@field@postnote } ||
\tl_if_eq_p:Nc \l_tmpb_tl { abx@field@postnote }
}
{ \clearfield { postnote } }
}
}
\ExplSyntaxOff
\begin{document}
\section{Section 1}
% Looks good.
\autocite[\pnfmt{3333-3345}\mytranslation{}]{sigfridsson}
% Also good.
\autocite[\pnfmt{3333-3345}\mytranslation]{sigfridsson}
\section{Section 2}
% Still good.
\autocite[\mytranslation{}]{sigfridsson}
% OK.
\autocite[\mytranslation]{sigfridsson}
\end{document}
```
| 0 | https://tex.stackexchange.com/users/105447 | 693658 | 321,792 |
https://tex.stackexchange.com/questions/155234 | 7 | I have an equation of matrices and I want to align the dimensions of the matrices below the equation of matrices. However, I produce something very ugly. Can someone advise how to make it look better or properly aligned ?
```
\documentclass[10pt,a4paper]{article}
\usepackage{amsmath, amsfonts}
\begin{document}
\begin{align*}
A
&
\begin{bmatrix}
&&\\
\vec{v}_1 & \cdots & \vec{v}_r \\
&&
\end{bmatrix}
&= &
\begin{bmatrix}
&&\\
\vec{u}_1 & \cdots & \vec{u}_r\\
&&
\end{bmatrix}
&
\begin{bmatrix}
\sigma_1 &&\\
&\ddots&\\
&& \sigma_r
\end{bmatrix}
\\
(m \times n) & (n \times r) & & (m \times r) & (r \times r)
\end{align*}
\end{document}
```
| https://tex.stackexchange.com/users/36684 | Align matrices problem | false | Here is a solution with `nicematrix`.
```
\documentclass{article}
\usepackage{nicematrix}
\begin{document}
\setlength{\arraycolsep}{8pt}
\NiceMatrixOptions{nullify-dots, last-row, code-for-last-row = \color{black}}
\[
\color{blue}
A
\begin{bNiceMatrix}
\\
\vec{v}_1 & \Cdots & \vec{v}_r \\
\\
\Block{1-3}{(m \times n)(n \times r)}
\end{bNiceMatrix}
=
\begin{bNiceMatrix}
\\
\vec{v}_1 & \Cdots & \vec{v}_r \\
\\
\Block{1-3}{(m \times r)}
\end{bNiceMatrix}
\begin{bNiceMatrix}
\sigma_1 \\
& \Ddots \\
& & \sigma_r
\\
\Block{1-3}{(r \times r)}
\end{bNiceMatrix}
\]
\end{document}
```
You need several compilations (because `nicematrix` uses PGF/Tikz nodes under the hood).
---
If you wish, you can add a background under the matrices with Tikz (by using the PGF/Tikz nodes created by `nicematrix` under the row, columns and cells of the matrices).
```
\documentclass{article}
\usepackage{nicematrix,tikz}
\begin{document}
\setlength{\arraycolsep}{8pt}
\NiceMatrixOptions{nullify-dots, last-row}
\[A
\begin{bNiceMatrix}[name=A]
\\
\vec{v}_1 & \Cdots & \vec{v}_r \\
\\
\Block{1-3}{(m \times n)(n \times r)}
\end{bNiceMatrix}
=
\begin{bNiceMatrix}
\\
\vec{v}_1 & \Cdots & \vec{v}_r \\
\\
\Block{1-3}{(m \times r)}
\end{bNiceMatrix}
\begin{bNiceMatrix}[name=B]
\sigma_1 \\
& \Ddots \\
& & \sigma_r
\\
\Block{1-3}{(r \times r)}
\end{bNiceMatrix}
\tikz [overlay, remember picture]
\fill [red!15,blend mode = multiply]
(A-1-|A-1) ++ (-6pt,0pt) rectangle (B-4-|B-4) ;
\]
\end{document}
```
| 2 | https://tex.stackexchange.com/users/163000 | 693660 | 321,793 |
https://tex.stackexchange.com/questions/693600 | 4 | I'm writing a handbook for my students and I want to create a command which should draw a task definition, its type and possible features, like source and link to the solution on YouTube.
In my plan all of these definitions should work (of course I use pseudo syntax here on purpose, just to show you my intention):
* `\task{definition=$x=3$}`
* `\task{definition=$x=3$, source='ABC'}`
* `\task{definition=$x=3$, link='https://youtube.ru'}`
* `\task{definition=$x=3$, source='ABC', link='https://youtube.ru'}`
But I cannot find any tool similar to optional and named arguments.
| https://tex.stackexchange.com/users/302499 | Is there a way to add optional and/or named argument to command | false | For a simple task, imho1, nothing beats the simplicity of `expkv-cs` and `\ekvcSplit` (this only works for up to 9 keys, for more it's most likely better to use methods from `expkv-def` which work similar to `\DeclareKeys` -- or another key=value implementation like the one built into LaTeX).
1I'm the author of `expkv` and family.
To have an easy way to add formatting instructions and extra text to a key one can use a front facing key that decorates some internal key. So every time you say `link = www.example.com` this becomes `link-internal={ (See www.example.com)}`.
Also in `expkv` you don't have to hide an additional `=`, but you'd have to hide a `,`.
This borrows the example created by @campa and modifies it to use `expkv-cs`:
```
\documentclass{article}
\usepackage{expkv-cs}
\ekvcSplit\task
{
% set up primary keys, all defaulting to an empty value
definition = {}
,source-internal = {}
,link-internal = {}
}
{This is a task with definition #1.#2#3}
% set up decorators
\ekvcSecondaryKeys\task
{
meta source = {source-internal = { You can find its source in #1.}}
,meta link = {link-internal = { (See #1)}}
}
\begin{document}
\parindent0pt
\task{definition=$x=3$}\par
\task{definition=$x=3$, source=ABC}\par
\task{definition=$x=3$, link=https://youtube.ru}\par
\task{definition=$x=3$, source=ABC, link=https://youtube.ru}
\task{definition=$x=3$}
\end{document}
```
---
Alternatively to the `\ekvcSplit` version, you could also use the `\ekvcHash` version, in which you can access the key-values by name (the entire list will be forwarded inside of `#1`, and `\ekvcValue` can be used to access items from that list -- this works for arbitrary many keys).
```
\documentclass{article}
\usepackage{expkv-cs}
\ekvcHash\task
{
% set up primary keys, all defaulting to an empty value
definition = {}
,source-internal = {}
,link-internal = {}
}
{%
This is a task with definition \ekvcValue{definition}{#1}.%
\ekvcValue{source-internal}{#1}%
\ekvcValue{link-internal}{#1}%
}
% set up decorators
\ekvcSecondaryKeys\task
{
meta source = {source-internal = { You can find its source in #1.}}
,meta link = {link-internal = { (See #1)}}
}
\begin{document}
\parindent0pt
\task{definition=$x=3$}\par
\task{definition=$x=3$, source=ABC}\par
\task{definition=$x=3$, link=https://youtube.ru}\par
\task{definition=$x=3$, source=ABC, link=https://youtube.ru}
\task{definition=$x=3$}
\end{document}
```
---
If you want an interface closer to the one provided by `\DeclareKeys` you could use `expkv-def`. In addition to a `store`-handler it also provides `dataT`. The instruction `dataT link = \taskLink` will define `\taskLink` such that by default it'll gobble the next token or brace-group, but if the key was used it'll put the value as `{<value>}` behind the next token or brace-group (and would strip the braces from that following brace-group).
```
\documentclass{article}
\usepackage{expkv-def}
\ekvdefinekeys{task}
{
store definition = \taskDefinition
,dataT source = \taskSource
,dataT link = \taskLink
}
\newcommand\taskSourceFormatter[1]{ You can find its source in #1.}
\newcommand\taskLinkFormatter[1]{ (See #1)}
\newcommand\task[1]
{%
\begingroup
\ekvset{task}{#1}%
This is a task with definition \taskDefinition.%
\taskSource\taskSourceFormatter
\taskLink\taskLinkFormatter
\endgroup
}
\begin{document}
\parindent0pt
\task{definition=$x=3$}\par
\task{definition=$x=3$, source=ABC}\par
\task{definition=$x=3$, link=https://youtube.ru}\par
\task{definition=$x=3$, source=ABC, link=https://youtube.ru}
\task{definition=$x=3$}
\end{document}
```
---
And if you really want to, you could use basically the same syntax as for `keyval` by using the basic `expkv` without any of the extension packages:
```
\documentclass{article}
\usepackage{expkv}
\newcommand*\taskDefinition{}
\newcommand*\taskSource{}
\newcommand*\taskLink{}
\ekvdef{task}{definition}{\def\taskDefinition{#1}}
\ekvdef{task}{source}{\def\taskSource{#1}}
\ekvdef{task}{link}{\def\taskLink{#1}}
\newcommand\task[1]
{%
\begingroup
\ekvset{task}{#1}%
This is a task with definition \taskDefinition.%
\ifx\taskSource\empty\else\space You can find its source in \taskSource.\fi
\ifx\taskLink\empty\else\space (See \taskLink)\fi
\endgroup
}
\begin{document}
\parindent0pt
\task{definition=$x=3$}\par
\task{definition=$x=3$, source=ABC}\par
\task{definition=$x=3$, link=https://youtube.ru}\par
\task{definition=$x=3$, source=ABC, link=https://youtube.ru}
\task{definition=$x=3$}
\end{document}
```
---
Result of all code blocks:
| 4 | https://tex.stackexchange.com/users/117050 | 693664 | 321,796 |
https://tex.stackexchange.com/questions/693505 | 1 | while there have been similar questions, mine have not been answered yet.
I am using `\usepackage[backend=biber, style=apa]{biblatex}` to cite my sources.
My paper cites a lot of organizations, UN Women, World Bank, UNICEF, and the like. Using Zotero, I have exported the corresponding Bibtex files and added the to my reference list. Multiple problems have occurred using `\autocite`:
1. For example, *UN Women* is always cited as *United Nations Entity for Gender Equality and the Empowerment of Women*. While that is the correct title, this heavily affects the flow of reading and I only want it to be written out the first time it is cited, afterwards it should be written as *UN Women* only. Same for the other organizations and other sources from UN Women.
2. Titles like the one above are only cited as *(for Gender Equality & the Empowerment of Women)* if no curly brackets are added to the author in the Bibtex source. As many organizations with long names are quoted within my theses, manually going through all citation keys would be very tedious, is there a way to solve this?
Any ideas how to solve this?
| https://tex.stackexchange.com/users/302448 | How to cite organizations properly? | false | 1. With the APA style, this is automatic as long as you have the full author in the `author` field and the short form in the `shortauthor` field.
2. You should usually put the full `author` field for group authors like this in braces so that they are not parsed as a normal name.
See examples 8.7d in the APA style documentation and data file:
<http://mirrors.ctan.org/macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa-test.pdf> (page 6)
<https://github.com/plk/biblatex-apa/blob/master/bibtex/bib/biblatex-apa-test-citations.bib>
| 1 | https://tex.stackexchange.com/users/1657 | 693669 | 321,799 |
https://tex.stackexchange.com/questions/693666 | 0 | Does anyone know how to enclose and color the vertices?
```
% https://q.uiver.app/#q=WzAsMTAsWzcsMCwidl8yIl0sWzAsMywidl8xIl0sWzcsMywidl83Il0sWzMsNCwidl82Il0sWzExLDQsInZfOCJdLFs1LDgsInZfezEwfSJdLFs0LDExLCJ2XzUiXSxbMTAsMTEsInZfNCJdLFs5LDgsInZfOSJdLFsxNCwzLCJ2XzMiXSxbMCwxLCIiLDEseyJjb2xvdXIiOlswLDYwLDYwXSwic3R5bGUiOnsiaGVhZCI6eyJuYW1lIjoibm9uZSJ9fX1dLFswLDIsIiIsMSx7ImNvbG91ciI6WzAsNjAsNjBdLCJzdHlsZSI6eyJoZWFkIjp7Im5hbWUiOiJub25lIn19fV0sWzEsMywiIiwxLHsiY29sb3VyIjpbMCw2MCw2MF0sInN0eWxlIjp7ImhlYWQiOnsibmFtZSI6Im5vbmUifX19XSxbNSw2LCIiLDEseyJjb2xvdXIiOlswLDYwLDYwXSwic3R5bGUiOnsiaGVhZCI6eyJuYW1lIjoibm9uZSJ9fX1dLFsxLDYsIiIsMSx7ImNvbG91ciI6WzAsNjAsNjBdLCJzdHlsZSI6eyJoZWFkIjp7Im5hbWUiOiJub25lIn19fV0sWzgsNywiIiwxLHsiY29sb3VyIjpbMCw2MCw2MF0sInN0eWxlIjp7ImhlYWQiOnsibmFtZSI6Im5vbmUifX19XSxbNiw3LCIiLDEseyJjb2xvdXIiOlswLDYwLDYwXSwic3R5bGUiOnsiaGVhZCI6eyJuYW1lIjoibm9uZSJ9fX1dLFs1LDIsIiIsMSx7ImNvbG91ciI6WzAsNjAsNjBdLCJzdHlsZSI6eyJoZWFkIjp7Im5hbWUiOiJub25lIn19fV0sWzIsOCwiIiwxLHsiY29sb3VyIjpbMCw2MCw2MF0sInN0eWxlIjp7ImhlYWQiOnsibmFtZSI6Im5vbmUifX19XSxbMyw0LCIiLDEseyJjb2xvdXIiOlswLDYwLDYwXSwic3R5bGUiOnsiaGVhZCI6eyJuYW1lIjoibm9uZSJ9fX1dLFs1LDQsIiIsMSx7ImNvbG91ciI6WzAsNjAsNjBdLCJzdHlsZSI6eyJoZWFkIjp7Im5hbWUiOiJub25lIn19fV0sWzgsMywiIiwxLHsiY29sb3VyIjpbMCw2MCw2MF0sInN0eWxlIjp7ImhlYWQiOnsibmFtZSI6Im5vbmUifX19XSxbMCw5LCIiLDEseyJjb2xvdXIiOlswLDYwLDYwXSwic3R5bGUiOnsiaGVhZCI6eyJuYW1lIjoibm9uZSJ9fX1dLFs5LDQsIiIsMSx7ImNvbG91ciI6WzAsNjAsNjBdLCJzdHlsZSI6eyJoZWFkIjp7Im5hbWUiOiJub25lIn19fV0sWzksNywiIiwxLHsiY29sb3VyIjpbMCw2MCw2MF0sInN0eWxlIjp7ImhlYWQiOnsibmFtZSI6Im5vbmUifX19XV0=
\[\begin{tikzcd}[cramped,sep=tiny]
&&&&&&& {v_2} \\
\\
\\
{v_1} &&&&&&& {v_7} &&&&&&& {v_3} \\
&&& {v_6} &&&&&&&& {v_8} \\
\\
\\
\\
&&&&& {v_{10}} &&&& {v_9} \\
\\
\\
&&&& {v_5} &&&&&& {v_4}
\arrow[color={rgb,255:red,214;green,92;blue,92}, no head, from=1-8, to=4-1]
\arrow[color={rgb,255:red,214;green,92;blue,92}, no head, from=1-8, to=4-8]
\arrow[color={rgb,255:red,214;green,92;blue,92}, no head, from=4-1, to=5-4]
\arrow[color={rgb,255:red,214;green,92;blue,92}, no head, from=9-6, to=12-5]
\arrow[color={rgb,255:red,214;green,92;blue,92}, no head, from=4-1, to=12-5]
\arrow[color={rgb,255:red,214;green,92;blue,92}, no head, from=9-10, to=12-11]
\arrow[color={rgb,255:red,214;green,92;blue,92}, no head, from=12-5, to=12-11]
\arrow[color={rgb,255:red,214;green,92;blue,92}, no head, from=9-6, to=4-8]
\arrow[color={rgb,255:red,214;green,92;blue,92}, no head, from=4-8, to=9-10]
\arrow[color={rgb,255:red,214;green,92;blue,92}, no head, from=5-4, to=5-12]
\arrow[color={rgb,255:red,214;green,92;blue,92}, no head, from=9-6, to=5-12]
\arrow[color={rgb,255:red,214;green,92;blue,92}, no head, from=9-10, to=5-4]
\arrow[color={rgb,255:red,214;green,92;blue,92}, no head, from=1-8, to=4-15]
\arrow[color={rgb,255:red,214;green,92;blue,92}, no head, from=4-15, to=5-12]
\arrow[color={rgb,255:red,214;green,92;blue,92}, no head, from=4-15, to=12-11]
\end{tikzcd}\]
```
| https://tex.stackexchange.com/users/286293 | How do I enclose and color vertices? | false | The quiver software/website isn't really the best to get started with TikZ-CD, it's rather verbose. The [library's manual](https://texdoc.org/serve/tikz-cd/0) is rather short and has examples.
Here's the same diagram with `\ar`rows from inside the cells with the target specification and no unnecessary empty rows and columns.
It doesn't look good. TikZ-CD is not the best tool for this diagram.
---
I believe placing the nodes in a circular fashion is much better which is what I show in the other two diagrams via the [`graphs` libraries](https://tikz.dev/tikz-graphs).
The first diagram only uses subgraphs of the `graphs.standard` library, however it isn't easy to specify colors for individual nodes here (it will need [a small bugfix](https://tex.stackexchange.com/a/659120)) but you can do the same manual and just add things like `[blue]` or `[draw=red]` as usual.
Code
----
```
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{cd, graphs.standard}
\definecolor{Red}{RGB}{214,92,92}
\begin{document}
\[
\begin{tikzcd}[column sep=.25em, row sep=1em, arrows={dash, Red}]
& & & & v_2 \ar[d] \ar[dllll] \ar[drrrr] \\
v_1 \ar[dr] \ar[dddrr]
& & & & v_7 \ar[ddl]\ar[ddr]
& & & & v_3 \ar[dl] \ar[dddll] \\
& |[blue]| v_6 \ar[rrrrrr] \ar[rrrrd]
& & & & & & v_8 \ar[dllll] \\
& & & v_{10}
& & v_9 \\
& & |[draw=red]| v_5 \ar[ru]\ar[rrrr]
& & & & v_4 \ar[lu]
\end{tikzcd}
\]
\[
\tikz\graph[
edges=Red, simple, radius=1.5cm,
clockwise=5, phase=90+360/5,
typeset=$v_{\tikzgraphnodename}$]{
subgraph K_n[V={6, ..., 10}] --
subgraph C_n[n=5]; % n = 5 is the same as V = {1, ..., 5}
subgraph C_n[V={6, ..., 10}, -!-]% remove the cycle, needs simple
};
\]
\[
\tikz\graph[
edges=Red, simple, radius=1.5cm,
clockwise=5, phase=90+360/5,
typeset=$v_{\tikzgraphnodename}$]{
{[clique] 6[blue], 7, 8, 9, 10} --
{[cycle] 1, 2, 3, 4, 5[draw=red]},
subgraph C_n[V={6, ..., 10}, -!-]% remove the cycle, needs simple
};
\]
\end{document}
```
Output
------
| 2 | https://tex.stackexchange.com/users/16595 | 693676 | 321,800 |
https://tex.stackexchange.com/questions/693679 | 4 | Is there a function akin to scanf of C that can simultaneously parse stdin or txt and assign them to variables? For example, I am trying to typeset a pdf from a text file. The first line contains the number of lines I should typeset, and the rest contains three numbers that form an addition problem.
```
$ cat input.txt
5
5 2 7
4 7 11
8 0 8
7 5 12
9 7 16
```
In C one could do as follows:
```
$ cat program.c
#include <stdio.h>
int main() {
FILE* input = fopen("input.txt", "r");
int n, a, b, c, i;
fscanf(input, "%d", &n);
for (i = 1; i <= n; i++) {
fscanf(input, "%d %d %d", &a, &b, &c);
printf("%d + %d = %d\n", a, b, c);
}
return 0;
}
$ gcc program.c -o program.o
$ program.o
5 + 2 = 7
4 + 7 = 11
8 + 0 = 8
7 + 5 = 12
9 + 7 = 16
```
I am close to a working example and just need to find the right command.
```
$ cat program.tex
\documentclass{article}
\usepackage{pgffor}
\begin{document}
\newread\input
\openin\input=input.txt
% Read first line and assign to n
\foreach \i in {1,...,n} {%
% Read line and assign to a, b, c
$\a + \b = \c$\\%
}%
\closein\input
\end{document}
```
| https://tex.stackexchange.com/users/302560 | scanf functionality in TeX? | false |
I added a computation to check the answers you had put in the file.
```
\documentclass{article}
\newread\x
\openin\x=input.txt
\begin{document}
\read\x to \varn
\def\do#1 #2 #3 #4\relax{%
\par
$#1 + #2 = #3\quad \mbox{check: } \the\numexpr#1+#2\relax$%
}
\loop
\read\x to\varline
\expandafter\do\varline\relax
\edef\varn{\the\numexpr\varn - 1}
\ifnum\varn>0
\repeat
\end{document}
```
Or as L3
```
\documentclass{article}
\ExplSyntaxOn
\ior_new:N\l_input
\ior_open:Nn\l_input{input.txt}
\ExplSyntaxOff
\begin{document}
\ExplSyntaxOn
\ior_get:NN\l_input\l_n
\cs_new:Npn\l_format:w #1 ~ #2 ~ #3 ~ #4\q_stop{
\par
$#1 + #2 = #3\quad \mbox{check: ~ } \int_eval:n{#1+#2}$
}
\bool_do_until:nn{ \int_compare_p:nNn \l_n = 0 }
{
\ExplSyntaxOff
\ior_get:NN\l_input\l_line
\ExplSyntaxOn
\exp_after:wN\l_format:w\l_line\q_stop
\cs_set:Npx\l_n{\int_eval:n{\l_n - 1}}
}
\end{document}
```
| 8 | https://tex.stackexchange.com/users/1090 | 693685 | 321,802 |
https://tex.stackexchange.com/questions/693687 | 2 | I understand that the less automatic solution to compare multiple integer logical statements is by using `\int_compare_p:nNn {...}{...}{...}` along with `\bool_if:nTF {condition(s)}{true}{false}`. My question is why does `\fp_compare:nTF {...}{...}{...}` works fine with logical operators but `\int_compare:nTF {...}{...}{...}` yield an error even though all of the values used are integers?
```
\documentclass{article}
\ExplSyntaxOn
\NewDocumentCommand{\compare}{mmm}{
\fp_compare:nTF {#1}{#2}{#3}
}
\NewDocumentCommand{\compareHardcode}{mm}{
\bool_if:nTF {
\int_compare_p:nNn {1} < {2} && \int_compare_p:nNn {2} < {3}
}{#1}{#2}
}
\NewDocumentCommand{\compareError}{mmm}{
%will not work using \int_compare:nTF
\int_compare:nTF {#1}{#2}{#3}
}
\ExplSyntaxOff
\begin{document}
\compare{1 < 2 && 2 < 3}{yes}{no} % prints yes
\compareHardcode{yes}{no} % prints yes
% Erroneous line commented:
% \compareError{1 < 2 && 2 < 3}{yes}{no}
\end{document}
```
| https://tex.stackexchange.com/users/167081 | Inconsistency between \int_compare and \fp_compare when dealing with logical operators | true | Something like `2<3` is a valid ⟨fp expr⟩ and `\fp_eval:n { 2<3 }` returns 1. You can also use logical operators. Examples:
```
\documentclass{article}
\begin{document}
\fpeval{1<2}
\fpeval{1<2 && 2<3}
\fpeval{1<2 || 3<2}
\fpeval{1>2 || 3<2}
\end{document}
```
This prints
1
1
1
0
So `\fp_compare:nTF { 1<2 && 2<3 } { yes } { no }` returns “yes”, because the evaluation is 1, which is nonzero.
To the contrary, `1<2` is not a valid ⟨int expr⟩. Moreover, you cannot use `\int_compare:nTF { 1<2 && 2<3 } { yes } { no }`, because the argument is invalid: the argument has to be in the form
⟨int expr⟩⟨relation⟩⟨int expr⟩⟨relation⟩…⟨int expr⟩⟨relation⟩⟨int expr⟩
and logical operators are not allowed.
| 3 | https://tex.stackexchange.com/users/4427 | 693690 | 321,805 |
https://tex.stackexchange.com/questions/693651 | 0 | I just started using `LaTeX` again after a long hiatus to prepare a new CV. I'm using [this template](https://www.overleaf.com/latex/templates/awesome-source-cv/wrdjtkkytqcw). So I looked at the class definition .cls and found the custom photo command and the newcommand `\idphoto` and where everything is used, but I'm totally lost how to change the code so the picture is rectangular. Otherwise I really like the template, so it would be really nice if somebody knows how to do this.
| https://tex.stackexchange.com/users/302538 | How to change photo format from circle to rectangle in a cv template | false | In the `cls` file, you have the definition of the `idphoto` command between lines 261 - 263, there you can show that is using the option circle.
```
\newcommand\idphoto{
\tikz\path[fill overzoom image={\@photo}]circle[radius=0.5\linewidth];
}
```
if you change the circle part with something like `(0, 0) rectangle (2.5, 2.5)` you will have the photo into a rectangular shape.
| 1 | https://tex.stackexchange.com/users/302207 | 693691 | 321,806 |
https://tex.stackexchange.com/questions/693679 | 4 | Is there a function akin to scanf of C that can simultaneously parse stdin or txt and assign them to variables? For example, I am trying to typeset a pdf from a text file. The first line contains the number of lines I should typeset, and the rest contains three numbers that form an addition problem.
```
$ cat input.txt
5
5 2 7
4 7 11
8 0 8
7 5 12
9 7 16
```
In C one could do as follows:
```
$ cat program.c
#include <stdio.h>
int main() {
FILE* input = fopen("input.txt", "r");
int n, a, b, c, i;
fscanf(input, "%d", &n);
for (i = 1; i <= n; i++) {
fscanf(input, "%d %d %d", &a, &b, &c);
printf("%d + %d = %d\n", a, b, c);
}
return 0;
}
$ gcc program.c -o program.o
$ program.o
5 + 2 = 7
4 + 7 = 11
8 + 0 = 8
7 + 5 = 12
9 + 7 = 16
```
I am close to a working example and just need to find the right command.
```
$ cat program.tex
\documentclass{article}
\usepackage{pgffor}
\begin{document}
\newread\input
\openin\input=input.txt
% Read first line and assign to n
\foreach \i in {1,...,n} {%
% Read line and assign to a, b, c
$\a + \b = \c$\\%
}%
\closein\input
\end{document}
```
| https://tex.stackexchange.com/users/302560 | scanf functionality in TeX? | false | I'd use `expl3`.
The first line is stored for deciding the number of operations to perform (it must be at most equal to the number of the following lines).
The other lines are mapped, with the help of a locally defined function, for which you specify the format of the arguments and what to do with them.
```
\begin{filecontents*}{\jobname.txt}
5
5 2 7
4 7 11
8 0 8
7 5 12
9 7 16
4 4 8
\end{filecontents*}
\begin{filecontents*}{\jobname-1.txt}
3
5 2 10
4 7 28
8 0 0
\end{filecontents*}
\documentclass{article}
\ExplSyntaxOn
\NewDocumentCommand{\operationsfromfile}{mm+m}
{% #1 = file name, #2 = args, #3 = template
\qem_opfromfile:nnn { #1 } { #2 } { #3 }
}
\ior_new:N \g_qem_opfromfile_ior
\tl_new:N \l__qem_opfromfile_number_tl
\int_new:N \l__qem_opfromfile_current_int
\cs_new_protected:Nn \qem_opfromfile:nnn
{
\cs_set:Npn \__qem_temp:w #2 \q_stop { #3 }
\int_zero:N \l__qem_opfromfile_current_int
\ior_open:Nn \g_qem_opfromfile_ior { #1 }
\ior_str_get:NN \g_qem_opfromfile_ior \l__qem_opfromfile_number_tl
\ior_str_map_inline:Nn \g_qem_opfromfile_ior
{
\int_incr:N \l__qem_opfromfile_current_int
\int_compare:nF { \l__qem_opfromfile_current_int > \l__qem_opfromfile_number_tl }
{
\__qem_temp:w ##1 \q_stop
}
}
\ior_close:N \g_qem_opfromfile_ior
}
\ExplSyntaxOff
\begin{document}
\operationsfromfile{\jobname.txt}{#1 #2 #3}{$#1+#2=#3$\par}
\operationsfromfile{\jobname-1.txt}{#1 #2 #3}{$#1\cdot#2=#3$\par}
\end{document}
```
| 5 | https://tex.stackexchange.com/users/4427 | 693692 | 321,807 |
https://tex.stackexchange.com/questions/272065 | 3 | I'm using Zotero to manage and export reference lists. Sometimes text fields contain an accent, circumflex, umlaut etc.
When I used such bib files in LyX (tried the `plain` and `unsrturl` styles), I get the following errors:
* `Command \texteuro unavailable in encoding T1` (similar error for OT1; using `\usepackage{textcomp}` [makes the error disappear](https://tex.stackexchange.com/questions/191813/command-texteuro-unavailable-in-encoding-t1))
* `Undefined control sequence`
* `Package inputenc Error: Keyboard character used is undefined` (still appears, even after using `\usepackage{textcomp}`)
Only when I replace accented characters with regular characters the code compiles.
| https://tex.stackexchange.com/users/49734 | How to solve encoding issues with Zotero-generated BibTeX file? | false | I am not using Lyx, but I have just gone through this issue with my own Zotero setup. The issue is that Zotero encodes everything with UTF-8 (Unicode), so the exported .bib files it creates will also have UTF-8 encoding. BibLaTex is UTF-8-compatible, but BibTex is not; so, if you are trying to compile with BibTex or Biber, i.e., you have a line such as `\usepackage[backend=biber, citestyle=chem-acs, maxbibnames=99]{biblatex}` in your preamble, it will give you an error complaining about UTF-8. In my case, I'm using TexWorks, so I only get the error when I *recompile* with pdfLaTex. This is a major issue and there are many open questions about it.
I tried adding `\usepackage[utf8]{inputenc}` to my preamble, but it didn't help.
A currently-working solution is to use the excellent 3rd party Zotero Add-on [zotero-better-bibtex](https://github.com/retorquere/zotero-better-bibtex) to export a BibTex-formatted .bib file with the UTF-8-encoded characters swapped to LaTeX-encoded characters. There is currently no way to do this by default in Zotero.
In order to install the add-on, I had to [upgrade to the latest version of Zotero](https://www.zotero.org/support/installation) and then install zotero-better-bibtex [according to the instructions](https://www.zotero.org/support/installation):
* Save the XPI file from <https://github.com/retorquere/zotero-better-bibtex/releases/tag/v6.7.111> to `~/somewhere`
* Manually install the .xpi from Zotero Add-ons menu
* restart Zotero
In order to export the .bib with unicode swapped to LaTeX
* select export > Format: `Better BibTex` (*not* `Better BibLaTex` (BibLaTex is UTF-8-compatible))
* In TexWorks,
1. Compile with pdfLaTeX
2. Compile with Biber
3. Compile with pdfLaTeX
I can now compile without errors and get a PDF of the bibliography with properly formatted special characters
| 1 | https://tex.stackexchange.com/users/214708 | 693702 | 321,810 |
https://tex.stackexchange.com/questions/33677 | 27 | This looks like the basic question but it seems like the hardest thing to me.
I need to set the whole document's font style as follows :
>
> Font Family: *Times New Roman* or *GoudyOlSt BT*
>
>
> Font Size: *11pt*
>
>
>
I am doing something like below but have no effect at all :
```
\fontencoding{T1}
\fontfamily{garamond}
\fontseries{m}
\fontshape{it}
\fontsize{11}{14}
\selectfont
```
Also, that would be nice to see the available font-family styles if possible.
I would really appreciate if someone direct me to right way.
| https://tex.stackexchange.com/users/8254 | Setting font family for the whole document | false | I wanted to use the san serif font LMSS under the `lmodern` family. Just like the above post mentions, you have to use the right packages:
```
\usepackage[T1]{fontenc}
\usepackage{lmodern} % Font Family
```
It was essential (at least for me) to specify the following:
```
\renewcommand{\rmdefault}{lmss}
```
| 0 | https://tex.stackexchange.com/users/302572 | 693711 | 321,812 |
https://tex.stackexchange.com/questions/693679 | 4 | Is there a function akin to scanf of C that can simultaneously parse stdin or txt and assign them to variables? For example, I am trying to typeset a pdf from a text file. The first line contains the number of lines I should typeset, and the rest contains three numbers that form an addition problem.
```
$ cat input.txt
5
5 2 7
4 7 11
8 0 8
7 5 12
9 7 16
```
In C one could do as follows:
```
$ cat program.c
#include <stdio.h>
int main() {
FILE* input = fopen("input.txt", "r");
int n, a, b, c, i;
fscanf(input, "%d", &n);
for (i = 1; i <= n; i++) {
fscanf(input, "%d %d %d", &a, &b, &c);
printf("%d + %d = %d\n", a, b, c);
}
return 0;
}
$ gcc program.c -o program.o
$ program.o
5 + 2 = 7
4 + 7 = 11
8 + 0 = 8
7 + 5 = 12
9 + 7 = 16
```
I am close to a working example and just need to find the right command.
```
$ cat program.tex
\documentclass{article}
\usepackage{pgffor}
\begin{document}
\newread\input
\openin\input=input.txt
% Read first line and assign to n
\foreach \i in {1,...,n} {%
% Read line and assign to a, b, c
$\a + \b = \c$\\%
}%
\closein\input
\end{document}
```
| https://tex.stackexchange.com/users/302560 | scanf functionality in TeX? | false | You can also use `\input` primitive instead `\read` primitive. It means that your data are scanned in the main input stream.
```
\def\scanf#1 {\par \def\num{#1}\ifnum\num>0 \expandafter\scanfA\fi}
\def\scanfA#1 #2 #3 {$#1+#2=#3$\par
\edef\num{\the\numexpr\num-1}
\ifnum\num>0 \expandafter\scanfA\fi
}
\expandafter\scanf\input input.txt
```
| 5 | https://tex.stackexchange.com/users/51799 | 693713 | 321,813 |
https://tex.stackexchange.com/questions/693700 | -1 | [Here](https://math.unm.edu/graduate/thesis-and-dissertation-template) contains a template for a thesis. In style\_sheets there's a template.tex file. The template works by editing that file and compiling. When one does so there is an appendix A and appendix B at the end of the pdf. I have used this write my thesis, but still am not able to remove appendix A and B. Erasing the appendix code in template.tex makes it where the file won't compile.
How can I remove the appendix chapters?
| https://tex.stackexchange.com/users/293261 | Unremovable Appendix Chapters in Thesis | false | If you don't need/want an appendix, just delete everything from (and including) `\chapter*{Appendices}` up to the end. That includes the whole `\addcontentsline{toc}{chapter}{Appendices}` block, `\appendix` and the two sample `\chapter`s.
Here is a reduced template, that compiles fine:
```
\documentclass[botnum, fleqn]{unmeethesis}
\begin{document}
\frontmatter
\title{An Awesome Thesis That Will Prove \\ to the Universe
That I Really Deserve This Honorable Degree}
\author{Albert Richard Einstein, III}
\degreesubject{M.S., Mathematics}
\degree{Master of Science \\ Mathematics}
\documenttype{Thesis}
\previousdegrees{A.A.S., University of Southern Swampland, 1988 \\
M.S., Art Therapy, University of New Mexico, 1991}
\date{December, \thisyear}
\maketitle
\begin{dedication}
To my parents.
\end{dedication}
\begin{acknowledgments}
\vspace{1.1in}
I would like to thank my advisor, Professor Martin Sheen.
\end{acknowledgments}
\maketitleabstract
\begin{abstract}
The theory of relativity is a real ``toughie'' to prove.
\clearpage
\end{abstract}
\tableofcontents
\listoffigures
\listoftables
\begin{glossary}{Longest string}
\item[$a_{lm}$]
Taylor series coefficients, where $l,m = \{0..2\}$
\item[$A_{\bf{p}}$]
Complex-valued scalar denoting the amplitude and phase.
\item[$A^T$]
Transpose of some relativity matrix.
\end{glossary}
\mainmatter
\chapter{Introduction}
\section{\label{section:overview}Overview}
The classic approach to proving a theorem is some really difficult
mathematics.
\section{Conclusions}
I conclude that this is a really short thesis.
\chapter{Future Work}
I'm sure my future work will consist of lots of other famous stuff.
\end{document}
```
That said, in the future please make it easier for people to be able to help you: downloading a custom class and template, in zipped form no less, is really not something that most people will do very often. This is why you're always asked to provide an MWE on this SX.
| 0 | https://tex.stackexchange.com/users/26614 | 693716 | 321,816 |
https://tex.stackexchange.com/questions/693680 | 2 | I know my headline sounds highly confusing so let me provide you my MWE
```
\documentclass{article}
\usepackage{tikz}
\usepackage[most]{tcolorbox}
\newtcolorbox{frameGray}{enhanced, colframe=black,colback=gray!3.5, boxrule=0.2pt,arc=0pt,outer arc=0pt,frame hidden, after skip = 12pt}
\newcommand{\boxGray}[1]{\tikz[baseline=(X.base)]\node [draw=gray!25,fill=gray!0,ultra thin,rectangle,inner sep=4pt,align=left] (X) {#1};}
\definecolor{bturq}{rgb}{0.0, 0.87, 0.87}
\newcommand{\raisedrule}[2][0em]{\leaders\hbox{\rule[#1]{1pt}{#2}}\hfill}
\newcommand{\hs}{\hspace{-6pt}}
\begin{document}
\pagenumbering{gobble}
\begin{frameGray}
\hs\boxGray{name, name:} \textcolor{bturq!60}{\raisedrule[3pt]{0.5pt}} \parbox{0.4\textwidth}{\boxGray{name, name}}
\vspace{10pt}
\hs\boxGray{place:} \textcolor{bturq!60}{\raisedrule[3pt]{0.5pt}} \parbox{0.4\textwidth}{\boxGray{place \\ place}}
\end{frameGray}
\end{document}
```
This will create some text-boxes with a rule that is horizontally connected to other text-boxes.
**What I want** is the text-boxes on the left to be centered on top each other, but still with a rule coming out right where the text-boxes end (as is it is right now, just that the boxes are not centered but left aligned). Seems tricky.
**Sketch**:
I got:
```
name, name ------------------- name, name
place
place ------------------------
place
```
I want:
```
name, name ------------------- name, name
place
place ----------------------
place
```
So that the text on the left is centered but the rules are still coming out from it.
| https://tex.stackexchange.com/users/216987 | How to center text-boxes and draw a rule from each box | true | Thank you for editing of question!
Is this what you after?
Above solution use of the `tikzmark` library, packages `tabularx` and `makecell`:
```
\documentclass{article}
\usepackage[most]{tcolorbox}
\usetikzlibrary{tikzmark}
\usepackage{makecell, tabularx}
\newtcolorbox{frameGray}{
enhanced,
frame hidden,
colback=gray!3.5,
arc=0pt,
after skip = 12pt}
\begin{document}
\pagenumbering{gobble}
\begin{frameGray}
\begin{tabularx}{\linewidth}{c X l}
\tikzmarknode{a}{name, name:}
& & \tikzmarknode{b}{name, name} \\[10pt]
\tikzmarknode{c}{place:}
& & \tikzmarknode{d}{\makecell[l]{place\\ place}}
\end{tabularx}
\begin{tikzpicture}[overlay,remember picture,
arr/.style = {color=cyan, semithick, shorten <=4pt, shorten >=4pt}
]
\draw[arr] (a) -- (b);
\draw[arr] (c) -- (d);
\end{tikzpicture}
\end{frameGray}
\end{document}
```
For showed result you need to compile MWE three times.
| 2 | https://tex.stackexchange.com/users/18189 | 693718 | 321,818 |
https://tex.stackexchange.com/questions/693719 | 2 | I have a list of names, say:
```
\newcommand{\names}{Fred, Barry, Joe, Jack, Zach}
```
and I just want to display the list in a randomized order a few times through my document.
Something like:
`Barry, Zach, Joe, Jack, Fred`
at the beginning and
`Joe, Zach, Barry, Fred, Jack`
near the middle of the document.
The closest simple solution I found was to use the package
```
\usepackage{probsoln}
\PSNrandseed{\time}
```
and in the document call:
```
\doforrandN{5}{\who}{\studentsnames}{
\who
}
```
But the problem is that the seed for randomization is created only once per compilation. Thus calling the randomized list twice in my document will give me two identical lists.
Any other simple way?
| https://tex.stackexchange.com/users/104915 | Itemize a name list randomly several times throught the document | false | This is (potentially) horrible code, but it will work (possibly by accident more than design).
```
\documentclass{article}
\usepackage{expl3}
\begin{document}
\ExplSyntaxOn
\clist_new:N \l__andrew_students
\clist_set:Nn \l__andrew_students{Zack, Barry, Fred, Jack, Joe}
\cs_new:Nn \print_students: {\clist_use:Nnnn \l__andrew_students {~and~} {,~} {,~ and~} }
\cs_new:Nn \randomise_students: {
\clist_sort:Nn \l__andrew_students {
\fp_compare:nNnTF {rand()} > {0.5}
{ \sort_return_swapped: }
{ \sort_return_same: }
}
}
\cs_new_eq:NN \randomisestudents\randomise_students:
\cs_new_eq:NN \printstudents\print_students:
\ExplSyntaxOff
\printstudents
\randomisestudents
\printstudents
\randomisestudents
\printstudents
\end{document}
```
To set the initial list may need another command, depending on how many times you need to change the list.
EDIT: I have a bit more time now, so a small amount of explanation.
I chose `clist` rather than `seq` (like @Skillmon's answer), but they behave (at least from a user's perspective) much the same (on the version I tested against). I did look through `interface3.pdf` for "shuffle", but didn't find it. I suspect that is due to the age of the install - it's the one that my (not exactly new) Linux package manager supplies (I think it's TeX Live 2018, but am not at that computer right now). I can see (on a more modern TeX Live) that `seq` has shuffle, and `clist` doesn't, though.
I have edited the style a bit, but I suspect it is still not fantastic.
Explanation of code:
* `\clist_set:Nn` sets the named variable to the provided comma-separated list
* the sort algorithm decides to swap two members of the list depending on if a random floating-point number (from 0 to 1) is bigger than .5 (rather than inherent features of the list)
* the `\clist_use:Nnnn` will print commas between items (except for the last two, which will be a comma and the word "and")
* This version will keep the order, unless `\randomisestudents` is called, which is slightly different from the other answer. This can be changed, by putting a call to `\randomise_students:` in the `\print_students:` method (either before or after the `clist_use`)
As @DavidCarlisle mentions, the use of `rand > 0.5` in a sort may lead to the sort never terminating, if the sort algorithm assumes `a>b` and `b>c` then `a>c`. As a result, I would not use this method or code for anything but a one-off project, where I can stop the run and restart if it looks like it is non-terminating.
Because it worked during testing, I didn't think too much about potential pitfalls.
| 2 | https://tex.stackexchange.com/users/244233 | 693721 | 321,819 |
https://tex.stackexchange.com/questions/693719 | 2 | I have a list of names, say:
```
\newcommand{\names}{Fred, Barry, Joe, Jack, Zach}
```
and I just want to display the list in a randomized order a few times through my document.
Something like:
`Barry, Zach, Joe, Jack, Fred`
at the beginning and
`Joe, Zach, Barry, Fred, Jack`
near the middle of the document.
The closest simple solution I found was to use the package
```
\usepackage{probsoln}
\PSNrandseed{\time}
```
and in the document call:
```
\doforrandN{5}{\who}{\studentsnames}{
\who
}
```
But the problem is that the seed for randomization is created only once per compilation. Thus calling the randomized list twice in my document will give me two identical lists.
Any other simple way?
| https://tex.stackexchange.com/users/104915 | Itemize a name list randomly several times throught the document | true | You can use L3 and its `\seq_shuffle:N` function. The following wraps it in some convenient macros:
```
\documentclass{article}
\ExplSyntaxOn
\NewDocumentCommand \setNameList { m m }
{
\seq_clear_new:c { l__andrew_namelist_#1_seq }
\seq_set_from_clist:cn { l__andrew_namelist_#1_seq } {#2}
}
\msg_new:nnn { andrew } { unknown-list } { Unknown~ list~ #1 }
\NewDocumentCommand \useNameListShuffled { m O{,~} }
{
\seq_if_exist:cTF { l__andrew_namelist_#1_seq }
{
\group_begin:
\seq_shuffle:c { l__andrew_namelist_#1_seq }
\seq_use:cn { l__andrew_namelist_#1_seq } {#2}
\group_end:
}
{ \msg_error:nnn { andrew } { unknown-list } {#1} }
}
\ExplSyntaxOff
\setNameList{names}{Fred, Barry, Joe, Jack, Zach}
\begin{document}
\useNameListShuffled{names}
\useNameListShuffled{names}[ and ]
\end{document}
```
| 6 | https://tex.stackexchange.com/users/117050 | 693723 | 321,820 |
https://tex.stackexchange.com/questions/693710 | 0 |
```
\documentclass[pdftex,10pt]{beamer}
\usepackage{amsmath,amsfonts,amssymb,epsfig,graphicx}
\usepackage{mathrsfs}
\usepackage{adjustbox}
\usepackage{tikz}
\usepackage{biblatex}
\usepackage{filecontents}
\usepackage[style=verbose,backend=biber]{biblatex}
\begin{filecontents}{references.bib}
@article {ssy1975, AUTHOR = {Schoen, R. and Simon, L. and Yau, S. T.}, TITLE = {Curvature estimates for minimal hypersurfaces}, JOURNAL = {Acta Math.}, FJOURNAL = {Acta Mathematica}, VOLUME = {134}, YEAR = {1975}, NUMBER = {3-4}, PAGES = {275--288}, MRCLASS = {53C40 (49F10)}, MRNUMBER = {423263}, MRREVIEWER = {Robert Gulliver},}
@article {fischer1980, AUTHOR = {Fischer-Colbrie, Doris and Schoen, Richard}, TITLE = {The structure of complete stable minimal surfaces in {$3$}-manifolds of nonnegative scalar curvature}, JOURNAL = {Comm. Pure Appl. Math.}, FJOURNAL = {Communications on Pure and Applied Mathematics}, VOLUME = {33}, YEAR = {1980}, NUMBER = {2}, PAGES = {199--211}, MRCLASS = {53C40 (58E12)}, MRNUMBER = {562550}, MRREVIEWER = {Themistocles M. Rassias},}
@article {peng1979, AUTHOR = {do Carmo, M. and Peng, C. K.}, TITLE = {Stable complete minimal surfaces in {${\bf R}\sp{3}$} are planes}, JOURNAL = {Bull. Amer. Math. Soc. (N.S.)}, FJOURNAL = {American Mathematical Society. Bulletin. New Series}, VOLUME = {1}, YEAR = {1979}, NUMBER = {6}, PAGES = {903--906}, MRCLASS = {53A10 (53C42)}, MRNUMBER = {546314}, MRREVIEWER = {F. J. Almgren, Jr.}, }
@article {chodosh2023, AUTHOR = {Chodosh, Otis and Li, Chao}, TITLE = {Stable minimal hypersurfaces in R4}, JOURNAL = {To appear in Acta. Math.}, FJOURNAL = {To appear in Acta. Math.}, VOLUME = {}, YEAR = {2023}, NUMBER = {}, PAGES = {},}
\end{filecontents}
\addbibresource{references.bib}
\begin{document}
\begin{frame}{} \begin{itemize} \item<tri@1-> Property of minimal graph: they are stable as hypersurfaces. \textit{Question: classify stable complete minimal hypersurfaces in $\mathbb{R}^n$ for $n\leq 8$}. \onslide<2->\item<tri@1-> Attempts: for $n\leq 6$, additionally with {\color{blue}volume growth condition}, they must be hyperplanes (\setbeamerfont{footnote}{size=\subscriptsize} Simon, Schoen, Yau \footfullcite{ssy1975}). \textit{Question: can volume growth condition be dropped for $n\leq 6$?} \onslide<3-> \item<tri@1-> "It must be hyperplane": for $n=3$, by \setbeamerfont{footnote}{size=\subscriptsize} {\color{red}Fischer-Colbrie&Schoen} \footfullcite{fischer1980} and \setbeamerfont{footnote}{size=\subscriptsize} do Carmo-Peng \footfullcite{peng1979} independently; Recently, for $n=4$, by \setbeamerfont{footnote}{size=\subscriptsize} Chodosh&Li \footfullcite{chodosh2023}. \end{itemize} \end{frame}
\end{document}
\begin{frame}[noframenumbering,plain,allowframebreaks] \printbibliography[heading=none] \end{frame}
```
I would like the references to show up one by one when I use "onslide", however, my code only shows all the references in every page. How do I change this?
| https://tex.stackexchange.com/users/302547 | Make footfullcite to show up the reference stepwisely when I use "onslide" | false |
```
\documentclass{beamer}
\usepackage[style=verbose,backend=biber]{biblatex}
\begin{filecontents*}[overwrite]{references.bib}
@article {ssy1975, AUTHOR = {Schoen, R. and Simon, L. and Yau, S. T.}, TITLE = {Curvature estimates for minimal hypersurfaces}, JOURNAL = {Acta Math.}, FJOURNAL = {Acta Mathematica}, VOLUME = {134}, YEAR = {1975}, NUMBER = {3-4}, PAGES = {275--288}, MRCLASS = {53C40 (49F10)}, MRNUMBER = {423263}, MRREVIEWER = {Robert Gulliver},}
@article {fischer1980, AUTHOR = {Fischer-Colbrie, Doris and Schoen, Richard}, TITLE = {The structure of complete stable minimal surfaces in {$3$}-manifolds of nonnegative scalar curvature}, JOURNAL = {Comm. Pure Appl. Math.}, FJOURNAL = {Communications on Pure and Applied Mathematics}, VOLUME = {33}, YEAR = {1980}, NUMBER = {2}, PAGES = {199--211}, MRCLASS = {53C40 (58E12)}, MRNUMBER = {562550}, MRREVIEWER = {Themistocles M. Rassias},}
@article {peng1979, AUTHOR = {do Carmo, M. and Peng, C. K.}, TITLE = {Stable complete minimal surfaces in {${\bf R}\sp{3}$} are planes}, JOURNAL = {Bull. Amer. Math. Soc. (N.S.)}, FJOURNAL = {American Mathematical Society. Bulletin. New Series}, VOLUME = {1}, YEAR = {1979}, NUMBER = {6}, PAGES = {903--906}, MRCLASS = {53A10 (53C42)}, MRNUMBER = {546314}, MRREVIEWER = {F. J. Almgren, Jr.}, }
@article {chodosh2023, AUTHOR = {Chodosh, Otis and Li, Chao}, TITLE = {Stable minimal hypersurfaces in R4}, JOURNAL = {To appear in Acta. Math.}, FJOURNAL = {To appear in Acta. Math.}, VOLUME = {}, YEAR = {2023}, NUMBER = {}, PAGES = {},}
\end{filecontents*}
\addbibresource{references.bib}
\begin{document}
\begin{frame}[t]
\begin{itemize}
\item<1-> \only<1->{\footfullcite{ssy1975}}
\item<3-> \only<3->{\footfullcite{fischer1980}} and \only<3->{\footfullcite{chodosh2023}}.
\end{itemize}
\end{frame}
\begin{frame}[noframenumbering,plain,allowframebreaks]
\printbibliography[heading=none]
\end{frame}
\end{document}
```
| 0 | https://tex.stackexchange.com/users/36296 | 693725 | 321,821 |
https://tex.stackexchange.com/questions/693724 | 1 | I am typing `\mathsf{\eta X \eta^\top}` to represent 3 matrices multiplying together. I choose to use sans-serif fonts as matrices, but the greek letter `\eta` cannot be displayed as sans-serif fonts.
I do not know if any font can have **sans-serif italic greek** in math mode. STIX Two does not work.
```
\usepackage{fontspec}
\setmainfont{TeX Gyre Termes}
\usepackage{unicode-math}
\unimathsetup{mathrm=sym,mathbf=sym,mathsf=sym,math-style=ISO,bold-style=ISO,sans-style=italic}
\setmathfont{STIX Two Math}
```
`\setmathfont[range=sfit/{greek,Greek}]{STIX Two Math}` this does not work:
```
I am trying to set up alphabet"sfit/greek" but
(unicode-math) there are no configuration settings for it. (See
(unicode-math) source file "unicode-math-alphabets.dtx" to
(unicode-math) debug.)
```
| https://tex.stackexchange.com/users/231103 | How to use sans-serif italic greek letter in math mode? | false | Unicode only specifies bold sans serif Greek not regular (for no sensible reason, it's just the way it is) which makes it hard to access sans Greek in any reasonable way. here I take Sans serif from Fira Math, note this is a "classic font change" so the result have standard Unicode slots and will lose the sans serif nature if cut and pasted elsewhere, unlike the bold sans which are using the Unicode Sans Serif math slots.
```
\documentclass{article}
\usepackage{unicode-math}
\setmainfont{TeX Gyre Termes}
\usepackage{unicode-math}
% First things first\unimathsetup{mathrm=sym,mathbf=sym,mathsf=sym,math-style=ISO,bold-style=ISO,sans-style=italic}
\setmathfont{STIX Two Math}
\setmathfontface{\hmmsf}[Scale = MatchLowercase]{Fira Math}
\begin{document}
1 $abc \alpha\beta\gamma$ % OK
2 $\symsf{abc \alpha\beta\gamma}$ % sigh
3 $\symsfit{abc \alpha\beta\gamma}$% sigh
4 $\symbfsf{abc \alpha\beta\gamma}$% OK
5 $\symbfsfit{abc \alpha\beta\gamma}$% OK
8 $\hmmsf{\mita\mitb\mitc \mitalpha\mitbeta\mitgamma}$ %OK
9 $\hmmsf{abc \mupalpha\mupbeta\mupgamma}$ % OK
\end{document}
```
| 4 | https://tex.stackexchange.com/users/1090 | 693726 | 321,822 |
https://tex.stackexchange.com/questions/693738 | 2 | I'm trying to check if a text label is empty. For this purpose, I tried to use the `\ifblank` command from the etoolbox package.
On the following MWE, I would expect that `\refdescx{\nameref{lab2}}` would return the text "EMPTY":
```
\documentclass[hidelinks,oneside]{book}
\usepackage{etoolbox}
\usepackage{hyperref}
\usepackage{cleveref}
\makeatletter
\newcommand{\refdescx}[1]{%
\protected@edef\@tempa{#1}%
\expandafter\ifblank\expandafter{\@tempa}{EMPTY}{NOT EMPTY'}%
}
\makeatother
\begin{document}
\chapter{First chapter}
\section{First section}
\label{lab1}
\section{}
\label{lab2}
\section{Third section}
\label{lab3}
References: ``\ref{lab1}'' ``\ref{lab2}''\newline
Names: ``\nameref{lab1}'' ``\nameref{lab2}''\newline
Check empty: ``\refdescx{\nameref{lab1}}'' ``\refdescx{\nameref{lab2}}''
\end{document}
```
| https://tex.stackexchange.com/users/290212 | Check if the text of a label is empty | true | Typically reference commands are not expandable: they want to issue a message if a reference is unknown, and hyperref wants to add links.
You can use the package refcount, it allows to retrieve the values in an expandable way:
```
\documentclass[hidelinks,oneside]{book}
\usepackage{etoolbox}
\usepackage{hyperref,refcount}
\usepackage{cleveref}
\makeatletter
\newcommand{\refdescx}[1]{%
\protected@edef\@tempa{#1}%
\expandafter\ifblank\expandafter{\@tempa}{EMPTY}{NOT EMPTY'}%
}
\makeatother
\begin{document}
\chapter{First chapter}
\section{First section}
\label{lab1}
\section{}
\label{lab2}
\section{Third section}
\label{lab3}
References: ``\ref{lab1}'' ``\ref{lab2}''\newline
Names: ``\nameref{lab1}'' ``\nameref{lab2}''\newline
Check empty: ``\refdescx{\getrefbykeydefault{lab1}{name}{}}'' ``\refdescx{\getrefbykeydefault{lab2}{name}{}}''
\end{document}
```
| 5 | https://tex.stackexchange.com/users/2388 | 693739 | 321,828 |
https://tex.stackexchange.com/questions/693724 | 1 | I am typing `\mathsf{\eta X \eta^\top}` to represent 3 matrices multiplying together. I choose to use sans-serif fonts as matrices, but the greek letter `\eta` cannot be displayed as sans-serif fonts.
I do not know if any font can have **sans-serif italic greek** in math mode. STIX Two does not work.
```
\usepackage{fontspec}
\setmainfont{TeX Gyre Termes}
\usepackage{unicode-math}
\unimathsetup{mathrm=sym,mathbf=sym,mathsf=sym,math-style=ISO,bold-style=ISO,sans-style=italic}
\setmathfont{STIX Two Math}
```
`\setmathfont[range=sfit/{greek,Greek}]{STIX Two Math}` this does not work:
```
I am trying to set up alphabet"sfit/greek" but
(unicode-math) there are no configuration settings for it. (See
(unicode-math) source file "unicode-math-alphabets.dtx" to
(unicode-math) debug.)
```
| https://tex.stackexchange.com/users/231103 | How to use sans-serif italic greek letter in math mode? | false | For those who seek Greek matching with Computer Modern fonts, the `fontsetup` package provides them with the New Computer Modern fonts.
```
\documentclass{article}
\usepackage{fontsetup}
\begin{document}
\[\msansalpha\msansbeta\msansGamma\msansDelta\msanseta\]
\[\mitsansalpha\mitsansbeta\mitsansGamma\mitsansDelta\mitsanseta\]
\end{document}
```
| 0 | https://tex.stackexchange.com/users/128462 | 693745 | 321,831 |
https://tex.stackexchange.com/questions/693748 | 0 | I am using the `enumitem` package. I entered the following in the preamble:
```
\renewlist{enumerate}{enumerate}{5}
\setlist[enumerate,1]{label={\textbf{(\alph*)}},ref=\alph*}
\setlist[enumerate,2]{label={\textbf{(\arabic*)}},ref=\theenumi.\arabic*}
\setlist[enumerate,3]{label={\textbf{(\Alph*)}},ref=\theenumii.\Alph*}
\setlist[enumerate,4]{label={\textbf{(\roman*)}},ref=\theenumiii.\roman*}
\setlist[enumerate,5]{label={\textbf{(\arabic*)}},ref=\theenumiv.\arabic*, left=\parindent}
```
Everything works fine unless I want to start a new list at a different level, say level 3 (enumiii). I cannot find a way to do that easily. Is it possible?
| https://tex.stackexchange.com/users/27120 | Starting new enumitem list at level 3 (enumiii) | false | The list nesting depth is in the count register `\@enumdepth` so if for some strange reason you need to fake already being inside a list use `\@enumdepth=2` and it will start the next list as if nested to level 3
| 3 | https://tex.stackexchange.com/users/1090 | 693749 | 321,833 |
https://tex.stackexchange.com/questions/693722 | 2 | as you see in the provided file, I tried to write a command that allows me to reference multiple figure, I want to use that instead of using \cref, \figref works perfectly but it only takes one figure, any help will be appreciated, thanks in advance
```
\documentclass{article}
\usepackage{etoolbox}
\usepackage{hyperref}
\hypersetup{
colorlinks=true,
linkcolor=red,
filecolor=red,
urlcolor=red,
citecolor=blue,
}
% The provided multifigref command
\newcommand*{\multifigref}[2][]{%
\def\figrefs{}%
\forcsvlist{\addfigref}{#2}%
\xdef\figrefs{\figrefs}%
\hyperref[{fig:\figrefs}]{%
\ifnumgreater{\clistcount{#2}}{1}{%
Figs.~\ref*{fig:\figrefs}}{%
Fig.~\ref*{fig:\figrefs}}%
\ifx\\#1\\%
\else
\,#1%
\fi
}%
}
\newcommand{\addfigref}[1]{%
\ifx\figrefs\empty%
\edef\figrefs{#1}%
\else
\edef\figrefs{\figrefs,#1}%
\fi
}
\newcommand*{\figref}[2][]{%
\hyperref[{fig:#2}]{%
Fig.~\ref*{fig:#2}%
\ifx\\#1\\%
\else
\,#1%
\fi
}%
}
\begin{document}
\begin{figure}
\caption{Caption for Figure 1}
\label{fig:fig1}
\end{figure}
\begin{figure}
\caption{Caption for Figure 2}
\label{fig:fig2}
\end{figure}
\begin{figure}
\caption{Caption for Figure 3}
\label{fig:fig3}
\end{figure}
\multifigref{fig1} vs \multifigref{fig1,fig2,fig3} \\
\figref{fig1} vs \figref{fig1,fig2,fig3}
\end{document}
```
| https://tex.stackexchange.com/users/302583 | \multifigref to use instead of \cref | false | Passing `fig:fig1,fig2,fig3` to the optional argument of `\hyperref` isn't going to work.
I suggest a single command `\figref`. The clist is transformed into a sequence setting each item as the argument to `\ref`. The sequence is then used.
```
\documentclass{article}
\usepackage{etoolbox}
\usepackage{hyperref}
\hypersetup{
colorlinks=true,
linkcolor=red,
filecolor=red,
urlcolor=red,
citecolor=blue,
}
\ExplSyntaxOn
% The provided multifigref command
\NewDocumentCommand{\figref}{om}
{
Fig\int_compare:nT { \clist_count:n { #2 } > 1 } { s }.\nobreakspace
\seq_clear:N \l_tmpa_seq
\clist_map_inline:nn { #2 }
{
\seq_put_right:Nn \l_tmpa_seq { \ref{fig:##1} }
}
\seq_use:Nn \l_tmpa_seq { ,~ }
\IfValueT{#1}{\,#1}
}
\ExplSyntaxOff
\begin{document}
\begin{figure}[!htp]
\caption{Caption for Figure 1}
\label{fig:fig1}
\end{figure}
\begin{figure}[!htp]
\caption{Caption for Figure 2}
\label{fig:fig2}
\end{figure}
\begin{figure}[!htp]
\caption{Caption for Figure 3}
\label{fig:fig3}
\end{figure}
\figref{fig1} vs \figref{fig1,fig2,fig3}
\figref[.]{fig1,fig2}
\end{document}
```
I'm not sure what the optional argument is for, however.
| 2 | https://tex.stackexchange.com/users/4427 | 693759 | 321,838 |
https://tex.stackexchange.com/questions/693763 | -1 |
```
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shapes, arrows}
\tikzstyle{startstop} = [rectangle, rounded corners, minimum width=3cm, minimum height=1cm,text centered, draw=black, fill=red!30]
\tikzstyle{io} = [trapezium, trapezium left angle=70, trapezium right angle=110, minimum width=3cm, minimum height=1cm, text centered, draw=black, fill=blue!30]
\tikzstyle{process} = [rectangle, minimum width=3cm, minimum height=1cm, text centered, draw=black, fill=orange!30]
\tikzstyle{decision} = [diamond, minimum width=3cm, minimum height=1cm, text centered, draw=black, fill=green!30]
\tikzstyle{arrow} = [thick,->,>=stealth]
\begin{document}
\begin{tikzpicture}[node distance=2cm]
\node (start) [startstop] {Start};
\node (input) [io, below of=start] {Read Input};
\node (i1) [process, below of=input] {$i = 1$};
\node (matrix) [process, below of=i1] {Initialize \\ \texttt{matrix}};
\node (matrix1) [process, below of=matrix] {Initialize \\ \texttt{matrix1}};
\node (loop) [decision, below of=matrix1, yshift=-0.5cm] {Loop Condition \\ $i > 0$};
\node (row) [io, below of=loop, yshift=-0.5cm] {Read Row};
\node (check) [decision, below of=row, yshift=-0.5cm] {Check \\ $-1$};
\node (invalid) [process, below of=check, yshift=-1cm] {Print \\ "Invalid Matrix"};
\node (pop) [process, right of=check, xshift=3.5cm] {Pop Last Row};
\node (valid) [process, below of=pop] {Append \\ to \texttt{matrix1}};
\node (transpose) [process, below of=valid] {Transpose \\ Matrix};
\node (print) [io, below of=transpose] {Print Transposed Matrix};
\node (error) [process, below of=loop, xshift=-4cm, yshift=-3cm] {Print \\ "Error"};
\node (stop) [startstop, below of=error] {Stop};
\draw [arrow] (start) -- (input);
\draw [arrow] (input) -- (i1);
\draw [arrow] (i1) -- (matrix);
\draw [arrow] (matrix) -- (matrix1);
\draw [arrow] (matrix1) -- (loop);
\draw [arrow] (loop) -- node[anchor=east] {yes} (row);
\draw [arrow] (row) -- (check);
\draw [arrow] (check) -- node[anchor=east] {no} (pop);
\draw [arrow] (check) -- node[anchor=south] {yes} (invalid);
\draw [arrow] (pop) -- (valid);
\draw [arrow] (valid) -- (transpose);
\draw [arrow] (transpose) -- (print);
\draw [arrow] (loop.west) -| node[anchor=south] {no} ++(-1.5,0) |- (stop);
\draw [arrow] (print.east) -- ++(1.5,0) |- (loop.east);
\draw [arrow] (loop.south) -- node[anchor=east] {error} (error.north);
\draw [arrow] (error) -- (stop);
\end{tikzpicture}
\end{document}
```
| https://tex.stackexchange.com/users/302611 | please draw flowchart | false | * Sorry, it is not entirely clear how your flowchart should looks. So, some arrows may be wrong oriented or missed.
* I guess that you may be after something like this:
* For above flowchart I additionally employ Ti*k*Z libraries `chains`, `ext.paths.ortho`, `positioning` and `quotes`.
* For nodes positioning is used `chains` library.
* consecutive nodes in branches are connected by help of ˙join`macro defined in`chains` library.
* Arrows between other arrows are drawn separately, where are used arrows defined in `ext.paths.ortho` libraries.
* For use `ext.paths.ortho` library you need to have installed ext-tikz` package, available on [CTAN](https://ctan.org/pkg/tikz-ext?lang=en).
```
\documentclass[margin=3mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{arrows.meta,https://ctan.org/pkg/tikz-ext?lang=en
chains,
ext.paths.ortho, % defined in the tikz-ext package
% https://ctan.org/pkg/tikz-ext?lang=en
positioning,
shapes.geometric}
\makeatletter
\tikzset{suspend join/.code={\def\tikz@after@path{}}}
\makeatother
\begin{document}
\begin{tikzpicture}[
node distance = 6 mm and 12 mm,
arr/.style = {-{Straight Barb[scale=0.8]}},
lbl/.style = {inner sep=1pt, label=below right:#1},
base/.style = {rectangle, rounded corners, draw,
text width=44mm, align=center, minimum height=1cm,
font=\sffamily},
startstop/.style = {base, rounded corners, fill=red!30},
process/.style = {base, fill=orange!30},
decision/.style = {diamond, aspect=1.3, draw, fill=green!30,
minimum width=32mm, minimum height=1cm,
inner xsep=0pt, align=center},
io/.style = {trapezium, trapezium stretches body,
trapezium left angle=70, trapezium right angle=110,
draw, fill=blue!30,
minimum width=44mm, minimum height=1cm,
text width=\pgfkeysvalueof{/pgf/minimum width}
-2*\pgfkeysvalueof{/pgf/inner xsep},
align=center}
]
\begin{scope}[start chain = going below,
nodes = {on chain, join=by arr}]
\node [startstop] {Start};
\node [io] {Read Input};
\node [process] {$i = 1$};
\node [process] {Initialize \\ \texttt{matrix}};
\node [process] {Initialize \\ \texttt{matrix1}};
\node (D1) [decision] {Loop Condition \\ $i > 0$};
%
\node [suspend join,io] {Read Row};
\node (D2) [decision] {Check \\ $-1$};
\node [process] {Print \\ "Invalid Matrix"};
\end{scope}
\begin{scope}[start chain = going below,
nodes = {on chain, join=by arr}]
\node (Pr) [process, right=of D2] {Pop Last Row};
\node [process] {Append \\ to \texttt{matrix1}};
\node [process] {Transpose \\ Matrix};
\node (IO) [io] {Print Transposed Matrix};
\end{scope}
\begin{scope}[start chain = going below,
nodes = {on chain, join=by arr}]
\node (print) [process, left=of D2] {Print \\ "Error"};
\node (stop) [startstop] {Stop};
\end{scope}
% arrows not drawn by join macro
\draw[arr] (D2.east) node[lbl=above right:No] {} -- (Pr);
\node[lbl=below right:Yes] at (D2.south) {};
%
\draw[arr] (D1.south) node[lbl=below right:Yes] {} |-| [distance=3mm] (print);
\draw[arr] (IO) r-rl (D1);
\draw[arr] (D1.west) node[lbl=above left:No ] {} r-lr (stop);
\draw[arr] (IO) r-rl (D1);
\end{tikzpicture}
\end{document}
```
* `tikzpicture` options can also be moved document in preamble (if you need this style settings also in other Ti*k*Z pictures) using in `\tikzset` :
```
% rest of preamble
% \usetikzlibrary{...}
\tizset{
% options from `tikzpicture
}
```
| 3 | https://tex.stackexchange.com/users/18189 | 693765 | 321,840 |
https://tex.stackexchange.com/questions/693763 | -1 |
```
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shapes, arrows}
\tikzstyle{startstop} = [rectangle, rounded corners, minimum width=3cm, minimum height=1cm,text centered, draw=black, fill=red!30]
\tikzstyle{io} = [trapezium, trapezium left angle=70, trapezium right angle=110, minimum width=3cm, minimum height=1cm, text centered, draw=black, fill=blue!30]
\tikzstyle{process} = [rectangle, minimum width=3cm, minimum height=1cm, text centered, draw=black, fill=orange!30]
\tikzstyle{decision} = [diamond, minimum width=3cm, minimum height=1cm, text centered, draw=black, fill=green!30]
\tikzstyle{arrow} = [thick,->,>=stealth]
\begin{document}
\begin{tikzpicture}[node distance=2cm]
\node (start) [startstop] {Start};
\node (input) [io, below of=start] {Read Input};
\node (i1) [process, below of=input] {$i = 1$};
\node (matrix) [process, below of=i1] {Initialize \\ \texttt{matrix}};
\node (matrix1) [process, below of=matrix] {Initialize \\ \texttt{matrix1}};
\node (loop) [decision, below of=matrix1, yshift=-0.5cm] {Loop Condition \\ $i > 0$};
\node (row) [io, below of=loop, yshift=-0.5cm] {Read Row};
\node (check) [decision, below of=row, yshift=-0.5cm] {Check \\ $-1$};
\node (invalid) [process, below of=check, yshift=-1cm] {Print \\ "Invalid Matrix"};
\node (pop) [process, right of=check, xshift=3.5cm] {Pop Last Row};
\node (valid) [process, below of=pop] {Append \\ to \texttt{matrix1}};
\node (transpose) [process, below of=valid] {Transpose \\ Matrix};
\node (print) [io, below of=transpose] {Print Transposed Matrix};
\node (error) [process, below of=loop, xshift=-4cm, yshift=-3cm] {Print \\ "Error"};
\node (stop) [startstop, below of=error] {Stop};
\draw [arrow] (start) -- (input);
\draw [arrow] (input) -- (i1);
\draw [arrow] (i1) -- (matrix);
\draw [arrow] (matrix) -- (matrix1);
\draw [arrow] (matrix1) -- (loop);
\draw [arrow] (loop) -- node[anchor=east] {yes} (row);
\draw [arrow] (row) -- (check);
\draw [arrow] (check) -- node[anchor=east] {no} (pop);
\draw [arrow] (check) -- node[anchor=south] {yes} (invalid);
\draw [arrow] (pop) -- (valid);
\draw [arrow] (valid) -- (transpose);
\draw [arrow] (transpose) -- (print);
\draw [arrow] (loop.west) -| node[anchor=south] {no} ++(-1.5,0) |- (stop);
\draw [arrow] (print.east) -- ++(1.5,0) |- (loop.east);
\draw [arrow] (loop.south) -- node[anchor=east] {error} (error.north);
\draw [arrow] (error) -- (stop);
\end{tikzpicture}
\end{document}
```
| https://tex.stackexchange.com/users/302611 | please draw flowchart | false | A few suggestions:
* Load the `positioning library`
* `\tikzset` instead of `\tikzstyle`
* `scale=.7, transform shape`
* `below=of start` or `below=1cm of start`
```
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shapes, arrows, positioning}
\tikzset{
startstop/.style={rectangle, rounded corners, minimum width=3cm, minimum height=1cm, align=center, draw=black, fill=red!30},
io/.style={trapezium, trapezium left angle=70, trapezium right angle=110, minimum width=3cm, minimum height=1cm, align=center, draw=black, fill=blue!30},
process/.style={rectangle, minimum width=3cm, minimum height=1cm, align=center, draw=black, fill=orange!30},
decision/.style={diamond, minimum width=3cm, minimum height=1cm, align=center, draw=black, fill=green!30},
arrow/.style={thick,->,>=stealth}
}
\begin{document}
\begin{tikzpicture}[scale=.7, transform shape, node distance=.5cm]
\node (start) [startstop] {Start};
\node (input) [io, below=of start] {Read Input};
\node (i1) [process, below=of input] {$i = 1$};
\node (matrix) [process, below=of i1] {Initialize \\ \texttt{matrix}};
\node (matrix1) [process, below=of matrix] {Initialize \\ \texttt{matrix1}};
\node (loop) [decision, below=of matrix1] {Loop Condition \\ $i > 0$};
\node (row) [io, below=1cm of loop] {Read Row};
\node (check) [decision, below=of row] {Check \\ $-1$};
\node (invalid) [process, below=1cm of check] {Print \\ "Invalid Matrix"};
\node (pop) [process, right=3cm of check] {Pop Last Row};
\node (valid) [process, below=of pop] {Append \\ to \texttt{matrix1}};
\node (transpose) [process, below=of valid] {Transpose \\ Matrix};
\node (print) [io, below=of transpose] {Print Transposed Matrix};
\node (error) [process, below left=3cm and 4cm of loop] {Print \\ "Error"};
\node (stop) [startstop, below=of error] {Stop};
\draw [arrow] (start) -- (input);
\draw [arrow] (input) -- (i1);
\draw [arrow] (i1) -- (matrix);
\draw [arrow] (matrix) -- (matrix1);
\draw [arrow] (matrix1) -- (loop);
\draw [arrow] (loop) -- node[right] {yes} (row);
\draw [arrow] (row) -- (check);
\draw [arrow] (check) -- node[above] {no} (pop);
\draw [arrow] (check) -- node[right] {yes} (invalid);
\draw [arrow] (pop) -- (valid);
\draw [arrow] (valid) -- (transpose);
\draw [arrow] (transpose) -- (print);
\draw [arrow] (loop.west) -| node[anchor=south] {no} ++(-1.5,0) |- (stop);
\draw [arrow] (print.east) -- ++(1.5,0) |- (loop.east);
\draw [arrow] (loop.south) -| node[anchor=east] {error} (error.north);
\draw [arrow] (error) -- (stop);
\end{tikzpicture}
\end{document}
```
| 3 | https://tex.stackexchange.com/users/125871 | 693766 | 321,841 |
https://tex.stackexchange.com/questions/235102 | 5 | I am using the subequations environment and observe non-uniform vertical spacing between subequations. Specifically, the space between the first and second equation is larger than the other spaces. Here is the code snippet:
```
\documentclass[12pt,fleqn,letterpaper]{article}
\usepackage[latin1]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\begin{document}
\begin{subequations}
\label{eq:omegai}
%
\begin{equation}
\label{eq:omega0}
\Omega_0
\end{equation}
%
\begin{equation}
\label{eq:omega1}
\Omega_1
\end{equation}
%
\begin{equation}
\label{eq:omega2}
\Omega_2
\end{equation}
%
\begin{equation}
\label{eq:omega3}
\Omega_3
\end{equation}
%
\end{subequations}
\end{document}
```
After doing some debugging I found that the offending command appears to be `fleqn` in the call to `\documentclass[12pt,fleqn,letterpaper]{article}`. If I remove `fleqn` the spacing is uniform. Any ideas how to get uniform vertical spacing and still use `fleqn`?
| https://tex.stackexchange.com/users/18450 | Why is there a larger vertical space after the first subequation? | false | I just ran into this problem and did not want to change what I already have much. Here is a workaround by adding an empty row to the top and setting a negative vertical distance for the line-break. It is based on the answer at <https://tex.stackexchange.com/a/223999/150849> .
```
Some paragraph.
\begin{subequations}\label{eq:exampleNLP}
\begin{align}
& \nonumber \\[-30pt]
& some equations \\
\end{align}
\end{subequations}
Some other paragraph.
```
| 0 | https://tex.stackexchange.com/users/150849 | 693785 | 321,849 |
https://tex.stackexchange.com/questions/235102 | 5 | I am using the subequations environment and observe non-uniform vertical spacing between subequations. Specifically, the space between the first and second equation is larger than the other spaces. Here is the code snippet:
```
\documentclass[12pt,fleqn,letterpaper]{article}
\usepackage[latin1]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\begin{document}
\begin{subequations}
\label{eq:omegai}
%
\begin{equation}
\label{eq:omega0}
\Omega_0
\end{equation}
%
\begin{equation}
\label{eq:omega1}
\Omega_1
\end{equation}
%
\begin{equation}
\label{eq:omega2}
\Omega_2
\end{equation}
%
\begin{equation}
\label{eq:omega3}
\Omega_3
\end{equation}
%
\end{subequations}
\end{document}
```
After doing some debugging I found that the offending command appears to be `fleqn` in the call to `\documentclass[12pt,fleqn,letterpaper]{article}`. If I remove `fleqn` the spacing is uniform. Any ideas how to get uniform vertical spacing and still use `fleqn`?
| https://tex.stackexchange.com/users/18450 | Why is there a larger vertical space after the first subequation? | false | There are `\abovedisplayskip` and `\belowdisplayskip` around the first equation but there are `\abovedisplayshortskip` and `\belowdisplayshortskip` around other equations. Because these registers have set different values, you see the uneven spacing. TeX internal algorithm uses `\*short*` registers for vertical spacing if there is a horizontal space between the last word of the previous paragraph and the beginning of the equation. Something like this:
```
last word
equation
```
but it uses no "short" registers in other cases, like this
```
last last lats last word
equation
```
| 1 | https://tex.stackexchange.com/users/51799 | 693790 | 321,852 |
https://tex.stackexchange.com/questions/693780 | 0 | After creating this table in my thesis, it broke the labels and captions for everything else in the document. I have searched for answers but cannot seem to find what is causing this to happen. Here is an abridged example:
```
\documentclass[12pt]{report}
\usepackage[utf8]{inputenc}
\usepackage{graphicx, newunicodechar}
\usepackage{textcomp, gensymb}
\usepackage{float}
\usepackage{makecell}
\usepackage[a4paper,
left=1in,
right=1in,
top=1in,
bottom=1in]{geometry}
\usepackage{tocloft}
\usepackage{etoolbox}
\usepackage{adjustbox}
\usepackage[sorting=none]{biblatex}
\usepackage{nomencl}
\usepackage{xltabular}
\usepackage{longtable}
\usepackage{tabu}
\usepackage{siunitx}
\usepackage{tabularx}
\usepackage{multirow}
\usepackage{booktabs}
\begin{document}
\begin{table}[ht]
\centering
% \caption{Experiment Data}
\begin{tabular}{cccccccccc}
\toprule
\multicolumn{2}{c}{Experiment 1} & \multicolumn{2}{c}{Experiment 2} & \multicolumn{2}{c}{Experiment 3} \\
\cmidrule(r){1-2} \cmidrule(r){3-4} \cmidrule(r){5-6}
Degree & R$^2$ & Degree & R$^2$ & Degree & R$^2$ \\
\midrule
1 & 0.76 & 1 & 0.77 & 1 & 0.77 \\
2 & 0.74 & 2 & 0.75 & 2 & 0.75 \\
3 & 0.75 & 3 & 0.75 & 3 & 0.75 \\
\bottomrule
\end{tabular}
\caption[R$&2$ fit values]{R$^2$ fit values for differing degree polynomial functions for each performance testing experiment.}
\label{Table:r2_val_table}
\end{table}
\end{document}
```
| https://tex.stackexchange.com/users/302627 | Multicolumn table broke the labels and captions | false | * With your MWE (Minimal working example is after removing all mistakes in tables' codes not possible to reproduce your problem
* Are all labels in tables unique and referenced correctly?
* An example with three successive tables:
```
\documentclass[12pt]{report}
%\usepackage[utf8]{inputenc} with recent LaTeX installation not needed
\usepackage{graphicx, newunicodechar}
\usepackage{textcomp, gensymb}
\usepackage{float}
\usepackage{makecell}
\usepackage[a4paper,
margin=1in]{geometry}
\usepackage{tocloft}
\usepackage{etoolbox}
\usepackage{adjustbox}
\usepackage[sorting=none]{biblatex}
\usepackage{nomencl}
\usepackage{xltabular}
\usepackage{longtable}
%\usepackage{tabu} % it is buggy and not maintained
\usepackage{siunitx}
\usepackage{tabularx}
\usepackage{multirow}
\usepackage{booktabs}
\begin{document}
\begin{table}[ht]
\centering
\begin{tabular}{cccccccccc}
\toprule
\multicolumn{2}{c}{Experiment 1}
& \multicolumn{2}{c}{Experiment 2}
& \multicolumn{2}{c}{Experiment 3} \\
\cmidrule(r){1-2} \cmidrule(r){3-4} \cmidrule(r){5-6}
Degree & $\mathrm{R}^2$
& Degree & $\mathrm{R}^2$
& Degree & $\mathrm{R}^2$ \\
\midrule
1 & 0.76 & 1 & 0.77 & 1 & 0.77 \\
\bottomrule
\end{tabular}
\caption[$\mathrm{R}^2$ fit values]{$\mathrm{R}^2$ fit values for \dots}
\label{Table:r2_val_table}
\end{table}
\begin{table}[ht]
\centering
\begin{tabular}{cccccccccc}
\toprule
\multicolumn{2}{c}{Experiment 1}
& \multicolumn{2}{c}{Experiment 2}
& \multicolumn{2}{c}{Experiment 3} \\
\cmidrule(r){1-2} \cmidrule(r){3-4} \cmidrule(r){5-6}
Degree & $\mathrm{R}^2$
& Degree & $\mathrm{R}^2$
& Degree & $\mathrm{R}^2$ \\
\midrule
1 & 0.76 & 1 & 0.77 & 1 & 0.77 \\
\bottomrule
\end{tabular}
\caption[$\mathrm{R}^2$ fit values]{$\mathrm{R}^2$ fit values for \dots}
\label{Table:2}
\end{table}
\begin{table}[ht]
\centering
\begin{tabular}{cccccccccc}
\toprule
\multicolumn{2}{c}{Experiment 1}
& \multicolumn{2}{c}{Experiment 2}
& \multicolumn{2}{c}{Experiment 3} \\
\cmidrule(r){1-2} \cmidrule(r){3-4} \cmidrule(r){5-6}
Degree & $\mathrm{R}^2$
& Degree & $\mathrm{R}^2$
& Degree & $\mathrm{R}^2$ \\
\midrule
1 & 0.76 & 1 & 0.77 & 1 & 0.77 \\
\bottomrule
\end{tabular}
\caption[$\mathrm{R}^2$ fit values]{$\mathrm{R}^2$ fit values for \dots}
\label{Table:3}
\end{table}
See table \ref{Table:r2_val_table}, \ref{Table:2} and \ref{Table:3} \dots
\end{document}
```
After two compilation referencing of your table is as expected:
Similar result is obtained at any number of tables in document. So with provided information it is unclear, what is your problem or what cause it.
| 0 | https://tex.stackexchange.com/users/18189 | 693797 | 321,854 |
https://tex.stackexchange.com/questions/693800 | 1 | As a teacher I would like to create some work sheets with gridded space after the question for the students to type their solutions in. I used tikz in order to make a 4mm x 4mm grid and this works just fine.
However, I want to have a solution paper, which is the same sheet but instead of an empty grid I would like to have the solution written on that grid. Is this somehow possible?
Thanks in advance!
| https://tex.stackexchange.com/users/292979 | How to overlay a tikz grid with text? | true | With no code there's a good amount of guessing. In my own school class I use something like this
```
\documentclass{article}
\usepackage{tikz}
\newif\ifsolution
\newcommand*{\grid}{}
\def\grid(#1,#2)#3{%
\tikz[baseline=(text.base)]{%
\draw[gray,step=.4](0,0)grid(.4*#1,-.4*#2);
\node[align=flush left,text width=.4*#1cm-3mm,anchor=north west] (text) at (0,0.1) {\strut\ifsolution#3\fi} ;
}%
}
\begin{document}
\solutiontrue
Hello \grid(4,7){world! How are you?}
\end{document}
```
The *x* and *y* values here are just the numbers of "boxes" (in your case 4mm each). The boolean `\ifsolution` controls the appearance of the solution.
| 3 | https://tex.stackexchange.com/users/82917 | 693801 | 321,857 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.