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/692011
0
when I build the tex document, the log show info: ``` (/opt/texlive/2023/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikz librarytopaths.code.tex))) (/opt/texlive/2023/texmf-dist/tex/latex/tcolorbox/tcolorbox.sty (/opt/texlive/2023/texmf-dist/tex/latex/tools/verbatim.sty) (/opt/texlive/2023/texmf-dist/tex/latex/environ/environ.sty (/opt/texlive/2023/texmf-dist/tex/latex/trimspaces/trimspaces.sty)) (/opt/texlive/2023/texmf-dist/tex/latex/tcolorbox/tcbskins.code.tex Library (tcolorbox): 'tcbskins.code.tex' version '6.0.4' ! LaTeX Error: File `tikzfill.image.sty' not found. Type X to quit or <RETURN> to proceed, or enter new name. (Default extension: sty) ``` I have tried to use this command to install this package `tikzfill.image`: ``` tlmgr install tikzfill.image ``` still did not fixed this issue. What should I do to fixed it?
https://tex.stackexchange.com/users/69600
LaTeX Error: File `tikzfill.image.sty' not found
true
``` tlmgr install tikzfill.image ``` you can't in general install individual files via `tlmgr` ``` $ tlmgr info tikzfill.image.sty tlmgr: cannot find package tikzfill.image.sty, searching for other matches: Packages containing `tikzfill.image.sty' in their title/description: Packages containing files matching `tikzfill.image.sty': tikzfill: texmf-dist/tex/latex/tikzfill/tikzfill.image.sty ``` shows that you need ``` tlmgr install tikzfill ```
4
https://tex.stackexchange.com/users/1090
692015
321,027
https://tex.stackexchange.com/questions/692017
0
I have successfully loaded `XML` in LuaLaTeX with help of `Michal.h21`. Now I would like to store all the customized defined `Lua Script` in a separate LaTeX Style file, like `bibr.sty`, so that I will call just `\usepackage{bibr}` in the LaTeX file. In the `bibr.sty` file all the customized defined `lua script` need to be defined. My BIBR Cross-Links XML file is below: ``` \documentclass{article} \usepackage{luacode} \usepackage{natbib} \begin{document} \begin{luacode*} local domobject = require "luaxml-domobject" local transform = require "luaxml-transform" sample = [[ <?xml version="1.0" encoding="utf-8"?> <art> <title>Scattering of flexural waves an electric current</title> <para>The first <xref ref-type="section" rid="Sec1">Section 1</xref> description and correlation between gait impairment and hydrocephalus were made in 1965 by Hakim and Adam (<xref ref-type="bibr" rid="B1">1</xref>). The etiology of idiopathic normal pressure hydrocephalus (iNPH) has not yet been entirely understood (<xref ref-type="bibr" rid="B2">2</xref>&#x02013;<xref ref-type="bibr" rid="B5">5</xref>). In elderly patients, other conditions such as spinal canal stenosis, Parkinson&#x00027;s disease, and polyneuropathy may influence the gait negatively.</para> </art>]] local dom = domobject.parse(sample) local function process_instructions(el) -- try to find <xref> followed by dash and another <xref> -- we then expand rid attributes for _, xref in ipairs(dom:query_selector("xref[ref-type='bibr']")) do local first = xref:get_sibling_node(1) local second = xref:get_sibling_node(2) if first and second and first:is_text() and first:get_text() == "–" and -- next node must be "–" text second:is_element() and second:get_element_name() == "xref" -- second element must be <xref> then local rid1 = xref:get_attribute("rid") or "" local rid2 = second:get_attribute("rid") or "" local prefix1, number1 = rid1:match("(%a+)(%d+)") local prefix2, number2 = rid2:match("(%a+)(%d+)") -- expand only if prefixes match each other if prefix1 and prefix2 and prefix1 == prefix2 then -- expand numbers local t = {} for i = number1, number2 do t[#t+1] = prefix1 .. math.floor(i) end -- save expanded numbers xref:set_attribute("rid", table.concat(t, ",")) -- remove unnecessary elements first:remove_node() second:remove_node() end end end end process_instructions(dom:root_node()) local transformer = transform.new() transformer:add_action("title", "\\section{@<.>}") transformer:add_action("para", "@<.>\\par") transformer:add_action("xref[ref-type='bibr']", "\\citep{@{rid}}") -- handle the processing instruction transformer:add_custom_action("lualatex-instruction", function(el) return el:get_attribute("text") end) local result = transformer:process_dom(dom) -- Print Output Result in Command-Prompt/Terminal print(result) -- Print Output Result in PDF uncomment below --transform.print_tex(result) \end{luacode*} \end{document} ``` How to achieve this?
https://tex.stackexchange.com/users/17075
Lua script in separate LaTeX Style File
false
You put this ``` \ProvidesPackage{bibr} \RequirePackage{luacode} \begin{luacode*} % HERE YOUR CODE, exactly as it is in your example \end{luacode*} ``` in a file, and save it with `.sty` extension in the same folder as your `.tex`.
2
https://tex.stackexchange.com/users/233251
692021
321,028
https://tex.stackexchange.com/questions/692018
0
I have text in two parallel columns and when I create an endnote it prints page, line-number followed by either "L" or "R" for the left or right column, i.e. 302,637R would be page 302, line 637, right column. But how can I change the font of the R to a smaller font? In the manual this seems to be the code: > > 238 XX Endnotes > > > > > The \endprint here is nearly identical in its functioning to \normalfootfmt. > > > > > The endnote file also contains \l@d@section commands, which supply the section numbers from the main text; standard reledmac does nothing with this information, but it is there if you want to write custom macros to do something with it. Ar- > guments are: > > > > > • #1 Line numbers and font selection. • #2 Lemma. > > > • #3 Note content. > > > • #4 Series. > > > • #5 Optional argument of \Xendnote. • #6Side(LorR). > > > • #7 Label for cross-referencing. > > > In my real world example this is the endnote to print: ``` \def \sw@list@inedtext {}% \parse@annot ||% \Aend{302|637|0|302|637|0|TU/garamond(0)/m/n}{\no@expands \textnormal {\emph {Why}}}{\textnormal {Some note}}{A}{}{R}{edtxt@631}% ``` One can spot the {R} that I try to access. How can I do this?
https://tex.stackexchange.com/users/63249
reledmac – font of "L" and "R" in linenumber of endnotes
false
Yes, @marquinho is right, I should’ve created an MWE. When I boiled down the code i saw the switch I had implemented. So the following code produces the wrong output ``` \documentclass{scrbook} \usepackage{reledmac} \usepackage{reledpar} \usepackage{blindtext} \NewCommandCopy{\printnpnumSave}{\printnpnum} \renewcommand*{\printnpnum}[1]{{\noindent}\tiny} \Xendsep{} \Xendafterpagenumber[A]{, } \Xendnotenumfont[A]{\tiny} \Xendnotenumfont{\huge{}} \begin{document} \begin{pairs} \begin{Leftside} \beginnumbering \pstart some text to the left \pend \pstart this is in the \edtext{left column}{\Aendnote{note}} \pend \endnumbering \end{Leftside} \end{pairs} \begin{pairs} \begin{Rightside} \beginnumbering \pstart some text to the right \pend \pstart this is \edtext{in the right column}{\Aendnote{note}} \pend \endnumbering \end{Rightside} \end{pairs}\Columns \vspace{2em} \doendnotes{A} \end{document} ``` but when one removes `\Xendnotenumfont{\huge{}}` everything is fine.
0
https://tex.stackexchange.com/users/63249
692025
321,030
https://tex.stackexchange.com/questions/692027
3
I want to change angle between edge but unable to do it. Code is given below ``` \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture} [sibling distance=25em, every node/.style = {shape=rectangle, rounded corners, draw, align=center, top color=white, bottom color=blue!20}, ] \node {Body\\ Temperature} child { node {Non\\Mammal} edge from parent [->] node [left] {Cold}} child { node {Give\\ Birth} edge from parent [->] node [right] {Warm} child { node {Mammal}edge from parent [->] node [left] {Yes}} child { node {Non \\ Mammal} edge from parent [->] node [right] {No}}}; \end{tikzpicture} \end{document} ```
https://tex.stackexchange.com/users/301368
How I can set angle between edge in given code?
false
What you probably want is the following (but I am not sure which angle you actually want to change, maybe you can add some more information to your question about this): ``` \documentclass[border=10pt]{standalone} \usepackage{tikz} \begin{document} \begin{tikzpicture}[ sibling distance=25em, every node/.style={ shape=rectangle, rounded corners, draw, align=center, top color=white, bottom color=blue!20 }, ] \node {Body \\ Temperature} child { node {Non \\ Mammal} edge from parent [->] node {Cold} } child { node {Give \\ Birth} child { node {Mammal} edge from parent [->] node {Yes} } child { node {Non \\ Mammal} edge from parent [->] node {No} } edge from parent [->] node {Warm} }; \end{tikzpicture} \end{document} ``` The `edge from parent` part should be placed after defining the `child`ren, especially if you add nodes that are to be placed on the edges (see [the manual](https://tikz.dev/tikz-trees#sec-21.6) for another example). For nicer positioning, I would remove the `right` or `left` option from the nodes that are placed on the edges. To change the angle in such a basic tree (that is, a Ti*k*Z tree that does not use any additional library), you can change the angle of the edges using the `sibling distance` and/or `level distance` options that you can not only add to the whole tree, but also to specific `child`ren. For example: ``` \documentclass[border=10pt]{standalone} \usepackage{tikz} \begin{document} \begin{tikzpicture}[ sibling distance=25em, every node/.style={ shape=rectangle, rounded corners, draw, align=center, top color=white, bottom color=blue!20 }, ] \node {Body \\ Temperature} child { node {Non \\ Mammal} edge from parent [->] node {Cold} } child { node {Give \\ Birth} child [sibling distance=5em] { node {Mammal} edge from parent [->] node {Yes} } child [level distance=10em] { node {Non \\ Mammal} edge from parent [->] node {No} } edge from parent [->] node {Warm} }; \end{tikzpicture} \end{document} ```
4
https://tex.stackexchange.com/users/47927
692030
321,032
https://tex.stackexchange.com/questions/692035
0
I've been trying to count a particular character within a string (an argument of a new environment I've defined). I came across [this](https://tex.stackexchange.com/q/336294/96582) question, where one of the [answers](https://tex.stackexchange.com/a/525246/96582) pointed me in the right direction. While I was able to adapt the suggested approach to my needs, a new problem arose: `Missing number, treated as zero. <read again> \xparse function is not expandable`. To make the suggested code initially work, I had to assign the argument of my new environment to a macro like this `\def\labelvalue{#1}\def\coloncount{\countin*{:}{\labelvalue}}`. Printing the result works fine and gives the correct result, but unfortunately the above error is thrown when I try to compare the result to an integer, e.g. `\ifnum \coloncount=1`. I found [this](https://topanswers.xyz/tex?q=2020) on the web, which links to the answer I was following, but I didn't get their suggestion to work. The aim is to define an environment that outputs different texts depending on the label passed. Since the labels are all structured according to the same scheme (rq:x or rq:x:y), it is to be decided which output is to take place depending on the number of colons. The document is compiled with latexmk and the most recent version of all packages used. ``` \ExplSyntaxOn % source: https://tex.stackexchange.com/a/525246/96582 \NewDocumentCommand{\countin}{smm} {% #1 = * if searching in a macro % #2 = string to search % #3 = token list to search in \IfBooleanTF { #1 } { \bruoga_countin:nV { #2 } #3 } { \bruoga_countin:nn { #2 } { #3 } } } \cs_new_protected:Nn \bruoga_countin:nn { \regex_count:nnN { #1 } { #2 } \l_tmpa_int \int_to_arabic:n { \l_tmpa_int } } \cs_generate_variant:Nn \bruoga_countin:nn { nV } \ExplSyntaxOff % ... % define environment <hypothesis> \newenvironment{hypothesis}[1]{% % #1 -> the label of the research question or subquestion it belongs to, e.g. rq:1 or rq:1.1 \def\refno{\getrefnumber{#1}} % value of the reference (if provided) or 0 \ifnum \refno=0% reference number is 0; missing label or new counter \textcolor{red}{THE PROVIDED (SUB)QUESTION LABEL DOES NOT EXIST!} \else% % this hypothesis could belong to a main or a subquestion. Since all labels are structured the same, check the provided label \def\labelvalue{#1} % #1 needs to be defined as macro for \countin to work! \def\coloncount{\countin*{:}{\labelvalue}} \coloncount \ifnum \coloncount=1% main question level1 \else% \ifnum \coloncount=2% sub question level2 \else%error \textcolor{red}{THE PROVIDED (SUB)QUESTION LABEL IS NOT VALID!} \fi \fi \fi }{% at the end of the environment \par } ```
https://tex.stackexchange.com/users/96582
LaTeX count number of occurrences within an argument
true
You don't need the full features of the commands in the linked question. ``` \documentclass{article} \usepackage{refcount,xcolor} \ExplSyntaxOn % define environment <hypothesis> \NewDocumentEnvironment{hypothesis}{m} {% #1 -> the label of the research question or subquestion it belongs to, e.g. rq:1 or rq:1.1 \int_compare:nTF { \getrefnumber{#1} = 0 } {% the label doesn't exist yet, or a rerun is needed \textcolor{red}{THE ~ PROVIDED ~ (SUB)QUESTION ~ LABEL ~ DOES ~ NOT ~ EXIST!} } {% this hypothesis could belong to a main or a subquestion. \regex_count:nnN { : } { #1 } \l_tmpa_int % Since all labels are structured the same, check the provided label \int_case:nnF { \l_tmpa_int } { {0}{level0} {1}{level1} {2}{level2} } {% error \textcolor{red}{THE ~ PROVIDED ~ (SUB)QUESTION ~ LABEL ~ IS ~ NOT ~ VALID!} } } } {% at the end of the environment \par } \ExplSyntaxOff \newcounter{test} \begin{document} \refstepcounter{test}\label{x} \refstepcounter{test}\label{x:y} \refstepcounter{test}\label{x:y:z} \refstepcounter{test}\label{x:y:z:w} \begin{hypothesis}{x} Some text \end{hypothesis} \begin{hypothesis}{x:y} Some text \end{hypothesis} \begin{hypothesis}{x:y:z} Some text \end{hypothesis} \begin{hypothesis}{x:y:z:w} Some text \end{hypothesis} \end{document} ```
2
https://tex.stackexchange.com/users/4427
692036
321,034
https://tex.stackexchange.com/questions/539545
2
When invoking `tlgmr`, especially in the course of a distribution upgrade, it fails very early with a PERL error `Can't locate TeXLive/TLConfig.pm in @INC` followed by a list for `@INC` in the following form : `@INC contains: /2020/texmf-dist/scripts/texlive /2020/tlpkg` etc. Setting the `PERL5LIB` to the appropriate folder allows to get a little further but things still fail with `kpathsea: configuration file texmf.cnf not found in these directories: /2020/bin/x86_64-linux` etc.
https://tex.stackexchange.com/users/103608
Can't locate TeXLive/TLConfig.pm in @INC
false
I believe, the problem is related to Perl. TeXLive expects certain Perl libraries to be present in the system. After reinstallation of Perl, the libraries are lost. I had to reinstall TeXLive (via Homebrew) and the problem disappeared.
0
https://tex.stackexchange.com/users/1449
692039
321,035
https://tex.stackexchange.com/questions/692017
0
I have successfully loaded `XML` in LuaLaTeX with help of `Michal.h21`. Now I would like to store all the customized defined `Lua Script` in a separate LaTeX Style file, like `bibr.sty`, so that I will call just `\usepackage{bibr}` in the LaTeX file. In the `bibr.sty` file all the customized defined `lua script` need to be defined. My BIBR Cross-Links XML file is below: ``` \documentclass{article} \usepackage{luacode} \usepackage{natbib} \begin{document} \begin{luacode*} local domobject = require "luaxml-domobject" local transform = require "luaxml-transform" sample = [[ <?xml version="1.0" encoding="utf-8"?> <art> <title>Scattering of flexural waves an electric current</title> <para>The first <xref ref-type="section" rid="Sec1">Section 1</xref> description and correlation between gait impairment and hydrocephalus were made in 1965 by Hakim and Adam (<xref ref-type="bibr" rid="B1">1</xref>). The etiology of idiopathic normal pressure hydrocephalus (iNPH) has not yet been entirely understood (<xref ref-type="bibr" rid="B2">2</xref>&#x02013;<xref ref-type="bibr" rid="B5">5</xref>). In elderly patients, other conditions such as spinal canal stenosis, Parkinson&#x00027;s disease, and polyneuropathy may influence the gait negatively.</para> </art>]] local dom = domobject.parse(sample) local function process_instructions(el) -- try to find <xref> followed by dash and another <xref> -- we then expand rid attributes for _, xref in ipairs(dom:query_selector("xref[ref-type='bibr']")) do local first = xref:get_sibling_node(1) local second = xref:get_sibling_node(2) if first and second and first:is_text() and first:get_text() == "–" and -- next node must be "–" text second:is_element() and second:get_element_name() == "xref" -- second element must be <xref> then local rid1 = xref:get_attribute("rid") or "" local rid2 = second:get_attribute("rid") or "" local prefix1, number1 = rid1:match("(%a+)(%d+)") local prefix2, number2 = rid2:match("(%a+)(%d+)") -- expand only if prefixes match each other if prefix1 and prefix2 and prefix1 == prefix2 then -- expand numbers local t = {} for i = number1, number2 do t[#t+1] = prefix1 .. math.floor(i) end -- save expanded numbers xref:set_attribute("rid", table.concat(t, ",")) -- remove unnecessary elements first:remove_node() second:remove_node() end end end end process_instructions(dom:root_node()) local transformer = transform.new() transformer:add_action("title", "\\section{@<.>}") transformer:add_action("para", "@<.>\\par") transformer:add_action("xref[ref-type='bibr']", "\\citep{@{rid}}") -- handle the processing instruction transformer:add_custom_action("lualatex-instruction", function(el) return el:get_attribute("text") end) local result = transformer:process_dom(dom) -- Print Output Result in Command-Prompt/Terminal print(result) -- Print Output Result in PDF uncomment below --transform.print_tex(result) \end{luacode*} \end{document} ``` How to achieve this?
https://tex.stackexchange.com/users/17075
Lua script in separate LaTeX Style File
true
As David suggested, it is a good idea to move the Lua code to a standalone file, to prevent some interaction issues between TeX and Lua. It could look like this, `bibr.lua`: ``` local M = {} local domobject = require "luaxml-domobject" local transform = require "luaxml-transform" local function process_instructions(el) for _, child in ipairs(el:get_children()) do local ntype = child:get_node_type() if ntype == "PI" and child._name=="LuaLaTeX" then local text = child._attr[ "_text" ] local newel = el:create_element("lualatex-instruction", {text = text}) child:replace_node(newel) end if child:is_element() then process_instructions(child) end end end function M.process(sample) local dom = domobject.parse(sample) -- try to find <xref> followed by dash and another <xref> -- we then expand rid attributes for _, xref in ipairs(dom:query_selector("xref[ref-type='bibr']")) do local first = xref:get_sibling_node(1) local second = xref:get_sibling_node(2) if first and second and first:is_text() and first:get_text() == "–" and -- next node must be "–" text second:is_element() and second:get_element_name() == "xref" -- second element must be <xref> then local rid1 = xref:get_attribute("rid") or "" local rid2 = second:get_attribute("rid") or "" local prefix1, number1 = rid1:match("(%a+)(%d+)") local prefix2, number2 = rid2:match("(%a+)(%d+)") -- expand only if prefixes match each other if prefix1 and prefix2 and prefix1 == prefix2 then -- expand numbers local t = {} for i = number1, number2 do t[#t+1] = prefix1 .. math.floor(i) end -- save expanded numbers xref:set_attribute("rid", table.concat(t, ",")) -- remove unnecessary elements first:remove_node() second:remove_node() end end end process_instructions(dom:root_node()) local transformer = transform.new() transformer:add_action("title", "\\section{@<.>}") transformer:add_action("para", "@<.>\\par") transformer:add_action("xref[ref-type='bibr']", "\\citep{@{rid}}") -- handle the processing instruction transformer:add_custom_action("lualatex-instruction", function(el) return el:get_attribute("text") end) local result = transformer:process_dom(dom) print(result) transform.print_tex(result) end function M.process_file(filename) local f = io.open(filename, "r") if not f then return nil, "Cannot open file: " .. filename end local content = f:read("*all") f:close() M.process(content) end return M ``` I've moved the code that was originally in the main body of the `luacode` environment to a function `M.process`. The `M` table is returned from this library, so it will enable you to use this code in this way: ``` local bibr = require "bibr" bibr.process("xml code...") ``` I've also made another function, `M.process_file`, which will transform XML file, so you don't need to pass the XML code to your document. You then need a LaTeX package that will provide commands that can be used in your documents. It can look like this, `bibr.sty`: ``` \ProvidesPackage{bibr} \NewDocumentEnvironment{processbibr}{+b}{% \directlua{ local bibr = require "bibr" bibr.process([[\unexpanded{#1}]]) } }{} \NewDocumentCommand\processbibrfile{m}{% \directlua{% local bibr = require "bibr" bibr.process_file("#1") } } \endinput ``` It provides `processbibr` environment and `\processbibrfile` command. The environment can be used if you want to put the XML code in the document, the command for including external XML files. It can be used like this: ``` \documentclass{article} \usepackage{natbib} \usepackage{bibr} \begin{document} \begin{processbibr} <?xml version="1.0" encoding="utf-8"?> <art> <title>Scattering of flexural waves an electric current</title> <para>Smart testing structures are $a+b$ components Reduce acoustic noise used in engineering applications that are capable of sensing or reacting to their environment change <?LuaLaTeX Sample XXX1?> their mechanical properties. in a predictable and desired manner. In addition to carrying mechanical loads, <?LuaLaTeX \hspace*{12pt}Abc?> alleviate vibration, reduce acoustic noise, change their mechanical properties as required or monitor their own condition.</para> <para>The first <xref ref-type="section" rid="Sec1">Section 1</xref> description and correlation between gait impairment and hydrocephalus were made in 1965 by Hakim and Adam (<xref ref-type="bibr" rid="B1">1</xref>). The etiology of idiopathic normal pressure hydrocephalus (iNPH) has not yet been entirely understood (<xref ref-type="bibr" rid="B2">2</xref>&#x02013;<xref ref-type="bibr" rid="B5">5</xref>). In elderly patients, other conditions such as spinal canal stenosis, Parkinson&#x00027;s disease, and polyneuropathy may influence the gait negatively.</para> </art> \end{processbibr} \processbibrfile{test.xml} \end{document} ``` In general, I think it is better to use `\processbibrfile`, as you shouldn't run into strange errors that can happen when you include the XML file directly to your TeX file. This is the result:
3
https://tex.stackexchange.com/users/2891
692040
321,036
https://tex.stackexchange.com/questions/692022
0
This is actually a more general question, but since a MWE is almost universally called for, consider David Carlisle's code ``` \documentclass{article} \usepackage{fontspec} \usepackage{nopageno} \newfontfamily\mathematica[NFSSFamily=mathematica]{STIX Two Math}% \DeclareSymbolFont{wm}{TU}{mathematica}{m}{n} \DeclareSymbolFont{wmb}{TU}{mathematica}{b}{n} \ExplSyntaxOn \Umathcode"03B1 = 0 \symwm "003B1 \Umathcode"03B2 = 0 \symwm "003B2 \NewDocumentCommand{\mapcommands}{mm} { \seq_set_from_clist:Nn\l_cmds{#1} \seq_set_from_clist:Nn\l_chars{#2} \seq_map_pairwise_function:NNN\l_cmds\l_chars\mapcommandfunction } \NewDocumentCommand{\mapcommandfunction}{mm}{\cs_set:Npx #1 {\codepoint_generate:nn{#2}{11}}} \mapcommands{\alphatwo,\beta}{"03B1,"03B2} \ExplSyntaxOff \show\alphatwo \begin{document} $$\alphatwo\beta$$ \end{document} ``` in his answer to one of my previous questions: <https://tex.stackexchange.com/a/691806/224317>. To make this code do everything I would like it to do, there needs to be a companion function called `\mapcodes` that maps standard codes like `"03B1` for a Greek alpha to the slot location in the specific font. The only essential difference is that it needs to include a third argument containing the font family and *probably* needs to accept a different type specifier in the first argument. A working version of that is provided by egreg here: <https://tex.stackexchange.com/a/691747/224317>. Now, for the tricky part and the gist of the question. I would like both of these functions to be able to take single arguments as well as comma-separated lists where applicable. As long as the list is provided "inline", I think they will work as is. I know for a fact that ``` \mapcommands{\alphatwo,\beta}{"03B1,"03B2} \mapcommands{\gamma}{"03B3} ``` causes no problem, for instance. I presume the second usage is treated as a list of length one. But I also would like to be able to create and name lists with commands of the form ``` \DeclareCommandList{GreekCommands}{\alpha,\beta,\gamma,\delta} \DeclareCodeList{GreekCodes}{"03B1,"03B2,"03B3,"03B4} ``` analogous to `\defineblock` in egreg's answer and then pass them as follows: ``` \mapcommands{GreekCommands}{GreekCodes} ``` I have experimented, but being new to `expl3` and still a little rough in my understanding of the underlying TeX expansion mechanism, I have not yet achieved success. I am guessing there is either (a) a way to take a generalized argument and then determine its nature, doing something applicable with each case, or (b) a way to do something equivalent to function overloading. It *appears* that `expl3` may provide something like this with variants in the `l3expan` package, but I'm not sure. So while I would like to solve this specific problem, I would also like to understand the differences in these two calling mechanisms in general, how to deal with them, tips for troubleshooting, and so forth.
https://tex.stackexchange.com/users/224317
Is it possible to define commands that accept different argument types?
false
The following adds the two macros and support for them to your MWE. The support is added by introducing two optional stars, if either star is given the next mandatory argument is considered as a named list input instead of a comma separated list. We could also not require the stars, and instead check whether such a list exists, if you need help with that just leave a comment. ``` \documentclass{article} \usepackage{fontspec} \usepackage{nopageno} \newfontfamily\mathematica[NFSSFamily=mathematica]{STIX Two Math}% \DeclareSymbolFont{wm}{TU}{mathematica}{m}{n} \DeclareSymbolFont{wmb}{TU}{mathematica}{b}{n} \ExplSyntaxOn \Umathcode"03B1 = 0 \symwm "003B1 \Umathcode"03B2 = 0 \symwm "003B2 \Umathcode"03B3 = 0 \symwm "003B3 \Umathcode"03B4 = 0 \symwm "003B4 \msg_new:nnn { mike-pugh } { unknown-cmd-list } { The~ named~ cmd~ list~ `#1'~ is~ unknown.~ Make~ sure~ you~ defined~ it. } \msg_new:nnn { mike-pugh } { unknown-char-list } { The~ named~ char~ list~ `#1'~ is~ unknown.~ Make~ sure~ you~ defined~ it. } \seq_new:N \l__mikepugh_cmds_seq \seq_new:N \l__mikepugh_chars_seq \NewDocumentCommand \mapcommands { s m s m } { \IfBooleanTF {#1} { \seq_if_exist:cTF { l__mikepugh_cmds_ \tl_to_str:n {#2} _seq } { \seq_set_eq:Nc \l__mikepugh_cmds_seq { l__mikepugh_cmds_ \tl_to_str:n {#2} _seq } } { \msg_error:nnn { mike-pugh } { unknown-cmd-list } {#2} } } { \seq_set_from_clist:Nn \l__mikepugh_cmds_seq {#2} } \IfBooleanTF {#3} { \seq_if_exist:cTF { l__mikepugh_chars_ \tl_to_str:n {#4} _seq } { \seq_set_eq:Nc \l__mikepugh_chars_seq { l__mikepugh_chars_ \tl_to_str:n {#4} _seq } } { \msg_error:nnn { mike-pugh } { unknown-char-list } {#2} } } { \seq_set_from_clist:Nn \l__mikepugh_chars_seq {#4} } \seq_map_pairwise_function:NNN \l__mikepugh_cmds_seq \l__mikepugh_chars_seq \mapcommandfunction } \NewDocumentCommand \DeclareCommandList { m m } { \seq_clear_new:c { l__mikepugh_cmds_ \tl_to_str:n {#1} _seq } \seq_set_from_clist:cn { l__mikepugh_cmds_ \tl_to_str:n {#1} _seq } {#2} } \NewDocumentCommand \DeclareCodeList { m m } { \seq_clear_new:c { l__mikepugh_chars_ \tl_to_str:n {#1} _seq } \seq_set_from_clist:cn { l__mikepugh_chars_ \tl_to_str:n {#1} _seq } {#2} } \NewDocumentCommand \mapcommandfunction { m m } { \cs_set:Npx #1 { \codepoint_generate:nn {#2} {11} } } \mapcommands{\alphatwo,\beta}{"03B1,"03B2} \DeclareCommandList{GreekCommands}{\alpha,\gamma,\delta} \DeclareCodeList{GreekCodes}{"03B1,"03B3,"03B4} \mapcommands*{GreekCommands}*{GreekCodes} \ExplSyntaxOff \show\alphatwo \show\delta \begin{document} \[\alphatwo\beta\delta\] \end{document} ```
1
https://tex.stackexchange.com/users/117050
692042
321,037
https://tex.stackexchange.com/questions/691889
7
How would one align the RHS by the "8"s in the following? I tried adding another column, and then left aligning the "999998" right, and the "00001" left, but there was a giant gap... ``` Table~\ref{tab:myNines} comes from the algebraic identitiy, $(a-b)^2 = a^2 - 2ab + b^2$, taking $a=10^n$ and $b=1$. \begin{table}[] \centering \begin{tabular}{l c l} $9^2$ &$=$ &$81$\\ $99^2$ &$=$ &$9801$\\ $999^2$ &$=$ &$998001$\\ $9999^2$ &$=$ &$99980001$\\ $99999^2$ &$=$ &$9999800001$\\ $999999^2$ &$=$ &$999998000001$\\ $9999999^2$ &$=$ &$99999980000001$\\ $99999999^2$ &$=$ &$9999999800000001$\\ $999999999^2$ &$=$ &$999999998000000001$\\ $9999999999^2$ &$=$ &$99999999980000000001$ \end{tabular} \caption{Note the Nines} \label{tab:myNines} \end{table} ```
https://tex.stackexchange.com/users/289717
align by any character in tabular
false
You can use TeX primitive `\halign` directly: ``` \halign{$#$\hfil${}={}$&\hfil#&#\hfil \cr 9^2 & &81 \cr 99^2 & 9&801 \cr 999^2 & 99&8001 \cr 9999^2 & 999&80001 \cr 99999^2 & 9999&800001 \cr 999999^2 & 99999&8000001 \cr 9999999^2 & 999999&80000001 \cr 99999999^2 & 9999999&800000001 \cr 999999999^2 & 99999999&8000000001 \cr 9999999999^2 & 999999999&80000000001 \cr } ```
3
https://tex.stackexchange.com/users/51799
692043
321,038
https://tex.stackexchange.com/questions/692048
-2
How may one define a symbol as `\sqsubset` but without the top line, and another symbol as `\sqsubset` but without the bottom line? Edit 1: At this point I use `\[x\bm{\sqsubset} y\longeq x \ \raisebox{-0.1pt}{\rotatebox[origin=c]{270}{L}} \ y\wedge x \ \raisebox{-2pt}{\rotatebox[origin=c]{270}{\reflectbox{L}}} \ y\]` , under graphicx and bm, and amsmath etc. The problem is to have `\raisebox{-0.1pt}{\rotatebox[origin=c]{270}{L}}` and `\raisebox{-2pt}{\rotatebox[origin=c]{270}{\reflectbox{L}}}` as similar as possible to `\bm{\sqsubset}`. The solution I have may be satisfactory, but it is not optimal.
https://tex.stackexchange.com/users/24406
\sqsubset without topline and bottomline
false
``` \documentclass{standalone} \usepackage{MnSymbol} \begin{document} $ \lefthalfcup \lefthalfcap $ \end{document} ```
2
https://tex.stackexchange.com/users/36296
692049
321,041
https://tex.stackexchange.com/questions/692048
-2
How may one define a symbol as `\sqsubset` but without the top line, and another symbol as `\sqsubset` but without the bottom line? Edit 1: At this point I use `\[x\bm{\sqsubset} y\longeq x \ \raisebox{-0.1pt}{\rotatebox[origin=c]{270}{L}} \ y\wedge x \ \raisebox{-2pt}{\rotatebox[origin=c]{270}{\reflectbox{L}}} \ y\]` , under graphicx and bm, and amsmath etc. The problem is to have `\raisebox{-0.1pt}{\rotatebox[origin=c]{270}{L}}` and `\raisebox{-2pt}{\rotatebox[origin=c]{270}{\reflectbox{L}}}` as similar as possible to `\bm{\sqsubset}`. The solution I have may be satisfactory, but it is not optimal.
https://tex.stackexchange.com/users/24406
\sqsubset without topline and bottomline
false
Use \raisebox{-0.1pt}{\rotatebox[origin=c]{270}{L}}and \raisebox{-2pt}{\rotatebox[origin=c]{270}{\reflectbox{L}}} under the graphicx package.
-2
https://tex.stackexchange.com/users/24406
692050
321,042
https://tex.stackexchange.com/questions/692051
4
I use the [novel](https://ctan.org/pkg/novel) package to typeset a novel for print, and I am really pleased by the beautiful, clean output with grid typesetting. Thanks, @rallg, for creating this package! However, the standard indentation is too large for my purpose. I read all the files and the whole HTML documentation, but I could not find out how to set the amount of the indentation. I tried putting `\setlength\parindent{10pt}` in the preamble, but this had no effect. Have I perhaps overlooked something? Would it be possible to change this setting in the first place? Here is the code of my document with the settings I'm using and some sample text. Thanks in advance for your answers. ``` % !TeX TS-program = lualatex % !TeX encoding = UTF-8 % % EXAMPLE OF NOVEL DOCUMENT CLASS % Uses mostly default layout. % IF YOU COMPILE THIS DOCUMENT: Be sure that this file, and its generated PDF, % have read/write permissions for any user. If they don't, then % compile will fail at the point where files are written. \documentclass{novel} % v. 1.81b. \SetTitle{Test Title} \SetSubtitle{Test Subtitle} \SetAuthor{Test Author} \SetPDFX[CGATSTR001]{X-1a:2001} \setotherlanguage{latin} % requires package hyphen-latin for best results. \SetFontSize{12pt} \setlength\parindent{10pt} \SetChapterStartStyle{empty} \SetChapterStartHeight{6} %\SetChapterFont[Numbers=Lining,Scale=1.8]{\parentfont} %\SetSubchFont[Numbers=Lining,Scale=1.4]{\parentfont} \SetMargins{1.5cm}{2.2cm}{1.5cm}{1.5cm} \SetHeadFootStyle{2} \begin{document} \frontmatter % i. Half-Title page: \thispagestyle{empty} \vspace*{6\nbs} \hfill\charscale[1.8]{\textbf{This is}}\par \vspace{\nbs} \hfill\charscale[2.4]{\textbf{\color{gray}the Test Title}}\par \clearpage % ii. Blank page: \thispagestyle{empty} \null \clearpage % iii. Full Title page: % \thispagestyle{empty} \vspace*{5\nbs} \begin{center} \charscale[2]{\textbf{This is}}\par \vspace{2\nbs} \charscale[3]{\textbf{\color{gray}the Test Title}}\par \vspace{1.5\nbs} \charscale[1.6]{This is the Test Subtitle}\par \vspace{4\nbs} \ChapterDeco[6]{\decoglyph{n9548}} \vspace{4\nbs} {\addfontfeature{Scale=3}\theAuthor} \vfill {\addfontfeature{Scale=1.25} Nonexistent Publications\\ Anytown • Anyplace • Anywhere}\par \end{center} \clearpage % iv. Copyright page: \thispagestyle{empty} \begin{center} \itshape{ \null \vfill \textsc{Test Title}\par Copyright ©2023 Test Author.\par % Whichever year, copyright holder. All Rights Reserved.\par % Usually no need to be elaborate. \null This is a work of fiction.\\ All persons and events are\\ from the author's imagination.\\ Resemblance to any real person,\\ living or dead, is coincidental.\par % Or similar language. \null ISBN 0-12345678-9\par % Whatever it is. No barcode, just number. \null Independently Published by Test Author,\par % Publisher is you, not the print/distribution service. Anytown, Anystate USA\par % Publisher's location. www.example.com/dhardcase/publications/\par % Contact for publisher or author. \null Publisher's Cataloging-In-Publication Data\\ available upon request.\par % Fiction often does not need catalog data. } % end itshape \end{center} \clearpage % v. Epigraph, Dedication, Table of Contents, or repeated Half-Title. % In this case, an Epigraph: \thispagestyle{empty} \vspace*{7\nbs} \begin{adjustwidth}{5em}{5em} \noindent Here would be the Epigraph \hfill---\textit{Author of the Epigraph}\par \end{adjustwidth} \cleartorecto % here, inserts blank, so mainmatter begins recto % Now to begin your story: \mainmatter % Chapter One: \begin{ChapterStart} \ChapterTitle{Prolog} \vspace*{2\nbs} \ChapterTitle{1} % \end{ChapterStart} The first sentence is not indented. Should be this way. This is the first sentence of the second paragraph. It is indented, which is fine, but I would like to have a smaller indentation. How can I change this setting? \end{document} ```
https://tex.stackexchange.com/users/298086
How can I set the length of the indentation in the novel document class?
false
`novel.cls` tries **really** hard to prevent you from playing around with various "text lengths" (which include `\parindent`). Two particular ways where this is done: 1. `novel.cls` calls `\gsetlength\parindent{1.5em}` inside an `\AtEndPreamble` (in fact all textlengths are set there); so any changes to `\parindent` in the preamble will be overwritten. 2. `novel.cls` **restores** `\parindent` to the default value at every `\end{ChapterStart}`. If you **really** want to change the default value, you will need to provide the new `\parindent` *after* `\begin{document}` and also bypass the restoration, by setting the length `\normalparindent`. So, try inserting immediately after `\begin{document}` ``` \begin{document} %%%% Add the following two lines to change the default parindent \gsetlength\parindent{10pt} \gsetlength\normalparindent\parindent %%%% end changes \frontmatter ```
7
https://tex.stackexchange.com/users/119
692053
321,043
https://tex.stackexchange.com/questions/692037
0
Is there an easy way to draw complex images in LaTeX? By this I mean: Have a look at the [following question](https://tex.stackexchange.com/questions/348/how-to-draw-a-torus). Some answers provide incredible pictures, very elaborated. In the (rudimentary) way I can create figures with tikz or pstricks, it would be impossible for me to come up with the correspondings codes. This made me think: Perhaps there are some tools that help write down the code. I am aware of things like [tikzcd-editor](https://tikzcd.yichuanshen.de/) or [LaTeXDraw](https://latexdraw.sourceforge.net/). I also know about [InKscape](https://inkscape.org/), although I have never used it myself. Howerver, none of them seem to be appropriate to draw tori or spheres. Yes, with LaTeXDraw one can draw ellipses and create things that resemble those surfaces, but the quality of these draws is as good as the quality of Paint. I am thinking more of some type of image recognition software that identifies the geometric object (as well as some text the figure might have) the user has drawn and produce the corresponding code. Does anything like that exist?
https://tex.stackexchange.com/users/122188
how to get hand draws into code
true
There are essentially two parts to your question: 1. You need to complete a computer vision task to interpret what user-defined sketches ought to be. There has been some progress in that front, a publicly accessible service in this direction is [Google's autodraw](https://experiments.withgoogle.com/autodraw), but that only really works for 2D sketches. I can imagine 3D being somewhat harder because you are trying to interpret a 3D image from a 2D projection. 2. You also then need an AI assistant to generate code based on the computer vision interpretation. This is allegedly one of the things that ChatGPT and other LLMs can do. So let's give it a try. Below the cut is the ChatGPT response to the prompt: "How do I draw a torus in TikZ". (For the curious, no, the code included does not build. To start it is missing `\usepackage{tikz-3dplot}`; and there are several other mistakes. Though not being a TikZ expert I cannot really decide how serious these issues are.) Using this as an illustration of status-quo, my guess would be that such a tool as you are looking for *does not yet exist*. --- Drawing a torus in TikZ involves a series of steps to define the 3D shape and then projecting it onto a 2D plane. Here's a step-by-step guide to drawing a torus using TikZ: Step 1: Load the necessary TikZ libraries To draw 3D shapes, we need to load the `tikz` package with the `3d` and `calc` libraries. Step 2: Define the torus parameters Decide on the major radius (distance from the center of the torus to the center of the tube) and the minor radius (radius of the tube). Step 3: Calculate the torus points Calculate the coordinates of the points that form the torus based on its parameters. Step 4: Draw the torus surface Using loops, connect the calculated points to form the surface of the torus. Step 5: Optional - Add shading and coloring You can add shading and color to enhance the appearance of the torus. Here's the TikZ code to draw a torus: ``` \documentclass{standalone} \usepackage{tikz} \usetikzlibrary{3d, calc} \begin{document} \begin{tikzpicture}[scale=1.5, tdplot_main_coords] % Torus Parameters \def\R{2} % Major radius (distance from center to center of the tube) \def\r{0.7} % Minor radius (radius of the tube) % Calculate the torus points \pgfmathsetmacro{\StepSize}{5} \foreach \i in {0,\StepSize,...,360} { \foreach \j in {0,\StepSize,...,360} { \pgfmathsetmacro{\x}{(\R + \r * cos(\j)) * cos(\i)} \pgfmathsetmacro{\y}{(\R + \r * cos(\j)) * sin(\i)} \pgfmathsetmacro{\z}{\r * sin(\j)} \coordinate (P) at (\x,\y,\z); \draw[fill=gray!50] (P) circle (0.05); % Optional: Draw points to check the torus points } } % Draw the torus surface \foreach \i in {0,...,72} { \foreach \j in {0,...,72} { \pgfmathtruncatemacro{\nexti}{mod(\i+1,73)} \pgfmathtruncatemacro{\nextj}{mod(\j+1,73)} \draw[thick, fill=blue!30] ($ (P\i\j)!0.5!(P\nexti\j) $) -- ($ (P\nexti\j)!0.5!(P\nexti\nextj) $) -- ($ (P\nexti\nextj)!0.5!(P\i\nextj) $) -- ($ (P\i\nextj)!0.5!(P\i\j) $) -- cycle; } } % Optional: Draw the torus center and axes \coordinate (Center) at (0,0,0); \draw[thick,-latex] (Center) -- (3,0,0) node[anchor=north east]{$x$}; \draw[thick,-latex] (Center) -- (0,3,0) node[anchor=north west]{$y$}; \draw[thick,-latex] (Center) -- (0,0,3) node[anchor=south]{$z$}; \draw[fill=red] (Center) circle (0.05); % Torus center point \end{tikzpicture} \end{document} ``` This code will create a 3D visualization of a torus. The `\R` and `\r` values can be adjusted to change the size of the torus. The resulting TikZ picture will be a 3D representation, and you can view it from different angles by rotating it in your PDF viewer. Remember to compile the document using a LaTeX compiler like `pdflatex`, and you should obtain the output containing the TikZ drawing of the torus.
1
https://tex.stackexchange.com/users/119
692054
321,044
https://tex.stackexchange.com/questions/650503
0
I would like to: (a) have no equation numbers for non-referenced equations; (b) have hyperlinks on equations and other constructs (lemmas/theorems/etc.); (c) use autoref so that the string for the relevant reference (equation, lemma, etc.) is automatically added. the code below doesn't work, no "Equation 1/2" appears. ``` \documentclass[10pt]{article} % For LaTeX2e \usepackage{hyperref} \usepackage{mathtools} \mathtoolsset{showonlyrefs,showmanualtags} \makeatletter \newcommand\Autoref[1]{\@first@ref#1,@} \def\@throw@dot#1.#2@{#1}% discard everything after the dot \def\@set@refname#1{% % set \@refname to autoefname+s using \getrefbykeydefault \edef\@tmp{\getrefbykeydefault{#1}{anchor}{}}% \xdef\@tmp{\expandafter\@throw@dot\@tmp.@}% \ltx@IfUndefined{\@tmp autorefnameplural}% {\def\@refname{\@nameuse{\@tmp autorefname}}}% {\def\@refname{\@nameuse{\@tmp autorefnameplural}}}% } \def\@first@ref#1,#2{% \ifx#2@\autoref{#1}\let\@nextref\@gobble% only one ref, revert to normal \autoref \else% \@set@refname{#1}% set \@refname to autoref name \@refname~\ref{#1}% add autoefname and first reference \let\@nextref\@next@ref% push processing to \@next@ref \fi% \@nextref#2% } \def\@next@ref#1,#2{% \ifx#2@ and~\ref{#1}\let\@nextref\@gobble% at end: print and+\ref and stop \else, \ref{#1}% print ,+\ref and continue \fi% \@nextref#2% } \makeatother \providecommand*{\equationautorefname}{Equation} \begin{document} \begin{equation} referenced \label{eq:1} \end{equation} \begin{align} referenced too \label{eq:2} \end{align} \begin{equation} unreferenced \end{equation} Consider \autoref{eq:1} and \autoref{eq:2}. It is referenced. \end{document} ``` EDIT: I read that the package autonum might help with, but the following doesn't work either (all I want is hyperlinked equations that are only labeled with numbers when they are referenced to): ``` \documentclass[10pt]{article} % For LaTeX2e \usepackage{amsmath} \usepackage{autonum} \usepackage{hyperref} \usepackage{cleveref} \makeatletter \newcommand\Autoref[1]{\@first@ref#1,@} \def\@throw@dot#1.#2@{#1}% discard everything after the dot \def\@set@refname#1{% % set \@refname to autoefname+s using \getrefbykeydefault \edef\@tmp{\getrefbykeydefault{#1}{anchor}{}}% \xdef\@tmp{\expandafter\@throw@dot\@tmp.@}% \ltx@IfUndefined{\@tmp autorefnameplural}% {\def\@refname{\@nameuse{\@tmp autorefname}}}% {\def\@refname{\@nameuse{\@tmp autorefnameplural}}}% } \def\@first@ref#1,#2{% \ifx#2@\autoref{#1}\let\@nextref\@gobble% only one ref, revert to normal \autoref \else% \@set@refname{#1}% set \@refname to autoref name \@refname~\ref{#1}% add autoefname and first reference \let\@nextref\@next@ref% push processing to \@next@ref \fi% \@nextref#2% } \def\@next@ref#1,#2{% \ifx#2@ and~\ref{#1}\let\@nextref\@gobble% at end: print and+\ref and stop \else, \ref{#1}% print ,+\ref and continue \fi% \@nextref#2% } \makeatother \providecommand*{\equationautorefname}{Equation} \begin{document} \begin{equation} referenced \label{eq:a} \end{equation} \begin{align} referenced too \label{eq:b} \end{align} \begin{equation} unreferenced \end{equation} Consider \autoref{eq:a} and \autoref{eq:b}. It is referenced. \ref{eq:a} \eqref{eq:a} \ref{eq:b} \eqref{eq:b} \ref{eq:a} \end{document} ```
https://tex.stackexchange.com/users/1970
mathtools and hyperref badly interacting?
false
I know this is an old question, but I just bumped into it. Anyway, `zref-clever` has support for `mathtools`'s `showonlyrefs` option. So you can have something like: ``` \documentclass[10pt]{article} \usepackage{zref-clever} \usepackage{mathtools} \mathtoolsset{showonlyrefs,showmanualtags} \usepackage{hyperref} \begin{document} \begin{equation} referenced \label{eq:a} \end{equation} \begin{align} referenced too \label{eq:b} \end{align} \begin{equation} unreferenced \end{equation} Consider \zcref{eq:a, eq:b}. They are referenced. \end{document} ```
0
https://tex.stackexchange.com/users/105447
692055
321,045
https://tex.stackexchange.com/questions/359257
3
I use `autonum` package to number the equations only when they are referenced. However, sometimes I want to refer to a range of equations. For example, I have 4 equations and I type `\eqref{eq1}-\eqref{eq4}`. But, the 2 equations in between will not be numbered, since they are not referenced. Is there some way to manually number these equations as well? Here is a minimal example ``` \documentclass{article} \usepackage{autonum} \begin{document} \begin{equation} equation 1 \label{e1} \end{equation} \begin{equation} equation 2 \end{equation} \begin{equation} equation 3 \end{equation} \begin{equation} equation 4 \label{e4} \end{equation} I want to refer to \eqref{e1}-\eqref{e4}, but the middle two will not be numbered with autonum. \end{document} ```
https://tex.stackexchange.com/users/117291
When using autonum for equation numbering, how to manually add number when not referenced
false
`autonum` offers "+" variants of math environments, including `equation+` which get numbered regardless of being referenced or not: ``` \documentclass{article} \usepackage{autonum} \begin{document} \begin{equation} equation 1 \label{e1} \end{equation} \begin{equation+} equation 2 \end{equation+} \begin{equation+} equation 3 \end{equation+} \begin{equation} equation 4 \label{e4} \end{equation} I want to refer to \eqref{e1}--\eqref{e4}, and now the middle two will also be numbered with autonum. \end{document} ```
0
https://tex.stackexchange.com/users/105447
692056
321,046
https://tex.stackexchange.com/questions/118010
6
The `braket` package defines Dirac's braket notation. To use it in Lyx, I add the line: ``` \usepackage{braket} ``` to the LaTeX preamble. Then Lyx will be able to compile commands like `\bra` and `\ket`. Problem is that the Lyx editor itself won't recognize this commands. If instead of using the `braket` package I had defined math-macros for the commands `\bra`, `\ket`, etc., I could tell Lyx how these things should look in the editor. That is, I can tell it to put an `\rangle` before the argument (that Lyx knows how to draw) and a `|` after. Is there a way to use the `\bra`, `\ket`, etc., commands from the `braket` package, and still be able to tell Lyx how these should look in the editor? EDIT: Right after posting, I discovered [this](https://tex.stackexchange.com/q/80002/19017) question, which mentions the Instant Preview feature of Lyx. Although this kind of fixes my issue, it's not exactly what I want. I want to be able to specify what the command should look like in the editor, in terms of other commands that Lyx already recognizes (in the editor), like I would do with a math-macro.
https://tex.stackexchange.com/users/19017
Using braket package with Lyx with WYSIWYG
false
This inconvenience is finally solved in From LyX-2.4.0-beta3 (format 616). You can just fill the LyX box to define how the macro displays in LyX and leave the TeX box empty, and things will work as expected. As written in the LyX source code: ``` * Format incremented to 616: Do not output LaTeX for a macro if the LaTeX part is empty - This allows the user to define the LyX display for LaTeX commands that are already defined (e.g., in user preamble or a package). ```
1
https://tex.stackexchange.com/users/217544
692058
321,047
https://tex.stackexchange.com/questions/692060
0
I want to create my own Journal template, and I would like to use other people's templates in <https://www.overleaf.com/latex/templates/tagged/academic-journal> Can I import a class and modify it to my liking? Is this legally ok?
https://tex.stackexchange.com/users/23436
Classes (.cls) copyright
true
There is no single answer to this question, and legal questions are not answerable here generally, since they depend on particular jurisdictions etc., That being said, many classes and packages are released under licences that allow reuse and modification. But you need to check the licence conditions themselves. As a rule of thumb, if the class or package is released under the LPPL licence, then you are free to develop a derived package or class using that code. If a class or package has no licensing information at all, then it's likely that you have no rights to create a modified class or package from that code. Copyright is a separate issue: most code is copyrighted by the original author(s) and that copyright doesn't disappear just because the code has an open source licence, so when you produce a modified work, you can't just take the code and call it your own. Therefore you should preserve original copyright notices in modified versions of code you modify. You do, however, own the copyright to the modifications you make.
6
https://tex.stackexchange.com/users/2693
692061
321,048
https://tex.stackexchange.com/questions/692062
0
I want to have the math symbols in section titles automatically be converted into plain text in bookmarks. I find this answer and it does clear the "token not allowed in a pdf string" warning. [Automatically add \texorpdfstring for math-mode in section titles](https://tex.stackexchange.com/questions/306988/automatically-add-texorpdfstring-for-math-mode-in-section-titles?noredirect=1&lq=1) However, as mentioned in the comment by egreg, the math symbols may output some strange Chinese characters in the bookmark. I wonder what cause this and how to avoid this issue?
https://tex.stackexchange.com/users/54169
\detokenize in bookmark create strange characters
false
Basically you can't avoid it. `\detokenize` is not a good idea. If you use a catcode 12 backslash in the title, may it be with `\detokenize` or `\string\` or something else, you will break the bookmarks. You get something like `\000\040\alp \000h\000a` and that is simply rubbish. I see no easy way to change this. At the place where a substitution could be done, hyperref has already replaced some commands by the internal representation which uses catcode 12 backslash too, and so no simple substitution is possible as it would break other commands like `\textbackslash`. One would need a regex and that would slow down the compilation quite a lot for a very small gain. What you naturally can do, is to pass the content of the math to the `\fake@math` command, and to predefine the set of symbols you use to do something sensible: ``` \documentclass{article} \usepackage{hyperref} \makeatletter \pdfstringdefDisableCommands{\let\(\fake@math} \pdfstringdefDisableCommands{\def\alpha{}} \pdfstringdefDisableCommands{\def\beta{}} \newcommand\fake@math{}% just for safety \def\fake@math#1\){[math: #1]} \makeatother \begin{document} \section{\(I \alpha \beta \) cast warnings but I wish I wouldnt} \end{document} ```
2
https://tex.stackexchange.com/users/2388
692077
321,053
https://tex.stackexchange.com/questions/691958
0
I would like the dashed and solid edges into the "Wife box" to enter the other way around to avoid intersections. ``` \documentclass{article} \usepackage[all]{genealogytree} \begin{document} \gtrset{ level 0/.style={level distance = 5mm}, dashed/.style={family edges={foreground={black,very thick,dashed},xshift=-1cm}} } \begin{tikzpicture} \genealogytree[timeflow = right,box={height=5mm,width=25mm,halign=center}]{ % child{ union[dashed]{ p[male,tikz={yshift=5mm}] { A.N.Other } c[female,tikz={yshift=2mm}] { Out of wedlock } } g[female] { Wife } p[male] { Husband} c[male] { Child of marriage } } } \end{tikzpicture} \end{document} ```
https://tex.stackexchange.com/users/219282
Avoid intersection in genealogytree of p and union
false
``` %The trick is to include a second "union" command \documentclass{article} \usepackage[all]{genealogytree} \begin{document} \gtrset{ level 0/.style={level distance = 5mm}, dashed/.style={family edges={foreground={black,very thick,dashed},xshift=-1cm}} } \subsection*{Original layout} \begin{tikzpicture} \genealogytree[timeflow = right,box={height=5mm,width=25mm,halign=center}]{ % child{ union[dashed]{ p[male,tikz={yshift=5mm}] { A.N.Other } c[female,tikz={yshift=2mm}] { Out of wedlock } } g[female] { Wife } p[male] { Husband} c[male] { Child of marriage } } } \end{tikzpicture} \subsection*{Layout with second union command} \begin{tikzpicture} \genealogytree[timeflow = right,box={height=5mm,width=25mm,halign=center}]{ % child{ union[dashed]{ p[male,tikz={yshift=5mm}] { A.N.Other } c[female,tikz={yshift=2mm}] { Out of wedlock } } g[female] { Wife } union{ p[male] { Husband} c[male] { Child of marriage } } } } \end{tikzpicture} \end{document} ```
0
https://tex.stackexchange.com/users/219282
692081
321,055
https://tex.stackexchange.com/questions/692075
1
,I have unsuccessfully been trying to learn how to use the `\newtcbinputlisting` command for some hours now. I am writing latex in overleaf with a group. We have several .py files we want to input and using minted isn't enough as some of them are more than a page long and therefore with `breaklines=true`, we have the problem where some lines go outside of the bg colorbox. in our latex repository an example of a file could be: ``` appendix/code/utils/diagnosis_descriptions.py ``` Can someone help me with creating `\newtcbinputlisting{mycode}` command for python? I would like to use the monokai minted style and bg as `\definecolor{bg}{HTML}{282828}`. I simply have not been able to make it input our file and have just met endlessly many errors in my own attempts link to example overleaf project <https://www.overleaf.com/3162436877yfgynkbsrcvr> My code: ``` % IMPORTANT! In order for the document to compile, one needs to use XeLaTeX or LuaLaTeX as compiler. This can be done in Overleaf by Menu -> Settings -> Compiler -> Choose XeLaTeX/LuaLaTeX \documentclass[12pt]{article} \renewcommand{\baselinestretch}{1.5} \usepackage[margin=1.4in]{geometry} % Package for pagemargin \usepackage{setspace} % Package for linespacing \usepackage{tabularx} % Package for table \usepackage[skip=10pt plus1pt, indent=20pt]{parskip} \usepackage{fontspec} \usepackage[style=ddmmyyyy]{datetime2} \usepackage[tracking=true]{microtype} \usepackage[style=numeric, backend=biber]{biblatex} \usepackage[toc,page]{appendix} % Package for creating appendix \usepackage{minted} % Package for inputting src code \usepackage{tcolorbox} \tcbuselibrary{minted, breakable} \definecolor{bg}{HTML}{282828} % styling for minted \newtcbinputlisting{\mycode}[2]{ listing engine=minted, minted language={python}, listing file={#2}, %left=5mm, minted style=default, minted options={ frame=lines, framesep=1mm, baselinestretch=1, bgcolor=bg, fontsize=\footnotesize, numbers=left, mathescape=true, breaklines=true, breakanywhere=true },% <-- put other minted options inside the brackets colback=bg, breakable, % Allows for code to continue on multiple pages listing only, } \begin{document} \mycode{appendix/code/utils/diagnosis_descriptions.py} \end{document} ```
https://tex.stackexchange.com/users/301404
Help with tcolorbox package and newtcbinputlisting
true
Two and a half problems: * several missing `,` in your `\newtcbinputlisting` * if you use `\mycode{diagnosis_descriptions.py}` the macro has one argument, but you defined your macro to have two argument, with the name of the python file as second argument. Either change the definition of your macro or use two arguments when you use it. * the minted user guide has the following to say about using a background colour: > > Be aware that if bgcolor is used with breaklines=true, and a line break occurs just before a page break, then text may extend below the colored background in some instances. It is best to use a more advanced framing package in those cases; > > > ... given that you are already using a more advanced framing package, setting a minted background colour is not anyway not useful. --- ``` % !TeX program = txs:///arara % arara: lualatex: {synctex: on, interaction: nonstopmode, shell: yes} \documentclass[12pt]{article} \renewcommand{\baselinestretch}{1.5} \usepackage[margin=1.4in]{geometry} % Package for pagemargin \usepackage{setspace} % Package for linespacing \usepackage{tabularx} % Package for table \usepackage[skip=10pt plus1pt, indent=20pt]{parskip} \usepackage{fontspec} \usepackage[style=ddmmyyyy]{datetime2} \usepackage[tracking=true]{microtype} \usepackage[style=numeric, backend=biber]{biblatex} \usepackage[toc,page]{appendix} % Package for creating appendix \usepackage{minted} % Package for inputting src code \usepackage{tcolorbox} \tcbuselibrary{minted, breakable} \definecolor{bg}{HTML}{282828} % styling for minted \newtcbinputlisting{\mycode}[1]{ listing engine=minted, minted language={python}, listing file={#1}, %left=5mm, minted style=default, % <- missing minted options={ frame=lines, framesep=1mm, baselinestretch=1, bgcolor={}, fontsize=\footnotesize, numbers=left, mathescape=true, breaklines=true, % <- missing breakanywhere=true },% <-- put other minted options inside the brackets colback=bg, breakable, % Allows for code to continue on multiple pages listing only, } \begin{document} \mycode{diagnosis_descriptions.py} \end{document} ```
1
https://tex.stackexchange.com/users/36296
692082
321,056
https://tex.stackexchange.com/questions/692016
4
I have been a LaTeX user for about two decades now, with a basic knowledge of the internal mechanisms and quirks of TeX. If at the beginning of my learning curve things didn’t appear too complicated, now I feel overwhelmed by the TeX world, especially when trying to bridge TeX with the “outside” world and with the new technologies: modern fonts and encodings, “modern” PDFs and document formats that go beyond the usual “paper” document, combining TeX with modern scripting languages, drawing and beyond, interactions with the web, e-books, online collaboration, … and this is just that comes through my mind right now. I know that there many users on tex.stackexchange.com that have a wide view over the current TeX world and a more comprehensive understanding about what goes “under the hood”, so that is why I would like ask you for a “*survival guide through the modern jungle of TeX*”: how would you guide someone lost? If you were to make a guide for the modern TeX world, what would you include in there, what would be the steps that someone like me would have to take in order to get a clearer understanding of the picture, to navigate and explore in all directions and not get lost along the way? I know that what I'm asking is not too precise, but feel free to contribute anything that you believe is most relevant, from your own perspective and experience.
https://tex.stackexchange.com/users/10635
A guide through the modern jungle of TeX
false
This is a partial answer to your question, as it only sees to the internal workings of (plain) LuaTeX. Other answers may give an overview of the current state of LaTeX. ### Manuals There is no single manual for modern TeX. Instead, you will have to consult the following in chronological order: * For the original (core) TeX, either the TeXBook or [Tex by Topic](https://ctan.org/pkg/texbytopic). * For the [eTeX](https://ctan.org/pkg/etex) extenstions, the [eTeX manual](https://ctan.org/pkg/etex) and the file `etex.src`. * For the pdf backend, the [pdfTeX reference manual](https://ctan.org/pkg/pdftex) and the [PDF specification](https://pdfa.org/resource/iso-32000-pdf/). * For LuaTeX, the [LuaTeX reference manual](https://ctan.org/pkg/luatex), together with the [`ltluatex`](https://ctan.org/pkg/luatexbase) and [`luaotfload`](https://ctan.org/pkg/luaotfload) support packages, as well as the file `luatex.ini` from which the plain LuaTeX format is generated. Every manual on this list expands on (and assumes you know) the previous one. For a concise diachronous overview of control sequences, you might like [this document[pdf]](https://petr.olsak.net/ftp/olsak/optex/tex-nutshell.pdf) by Petr Olšák. ### Outdated parts In the above (and here on SE) you should ignore anything that talks about: * The `dvi` format or PostScript (`ps` and `eps`): use PDF instead. * Fonts in the `tfm` format: use TrueType (`ttf`) or OpenType (`otf`) fonts instead. * Text encodings: just use unicode (utf-8) and a modern font. ### Vector graphics The popular [`tikz`](https://www.ctan.org/pkg/pgf) can make use of all modern PDF features. Consider using [`pgfplots`](https://www.ctan.org/pkg/pgfplots) for plots and diagrams. To these, LuaTeX adds the option of using MetaPost directly. For doing so, you have the choice between [`luamplib`](https://www.ctan.org/pkg/luamplib) and [`minim-mp`](https://www.ctan.org/pkg/minim-mp). Their feature sets are not identical, so the choice will have to depend on the specifics of your use-case. The latter can also be used as a stand-alone MetaPost compiler. ### Mathematical typesetting This part is especially fragmented. Plain TeX has at least three counterparts to LaTeX’s `unicode-math`: * The luatex-plain format that comes with the ConTeXt distribution contains quick-and-dirty support for unicode mathematics (in the file `luatex-math.tex`) that *might* be good enough for your needs. * The [OpTeX extended plain format](https://petr.olsak.net/optex/) includes a more comprehensive approach baked-in (but then you will have to use the rest of OpTeX, too); it comes with a [summary of mathematical typesetting[pdf]](https://petr.olsak.net/ftp/olsak/optex/optex-math.pdf) that is worth reading even if you will never use OpTeX. * Otherwise, the [`minim-math`](https://www.ctan.org/pkg/minim-math) package provides comprehensive and format-agnostic mathematics support. ### PDF features * For hyperlinks and bookmarks, see either [`navigator`](https://www.ctan.org/pkg/navigator) or [`minim-pdf`](https://www.ctan.org/pkg/minim-pdf). * For generating tagged PDF and PDF/A, see [`minim-pdf`](https://www.ctan.org/pkg/minim-pdf). * For XMP inclusion, see [`minim-xmp`](https://www.ctan.org/pkg/minim-xmp).
4
https://tex.stackexchange.com/users/258593
692084
321,057
https://tex.stackexchange.com/questions/186068
77
arXiv is smart enough to detect whether your PDF is generated by LaTeX. If it is, arXiv asks for the sources of the PDF instead of the PDF file itself. This is really annoying and inconvenient. I ask a way to fool the arXiv and avoid PDFs being detected as generated by LaTeX (even if they were indeed). I have tried this: <http://www.hrstc.org/node/62>: "create a pdf from word and then simply insert pages from your article, and delete the word's page". And it did not work.
https://tex.stackexchange.com/users/49529
How to upload LaTeX-generated pdf paper to arXiv without LaTeX sources
false
I just found the way to do it (Worked 2023-07-27). Using Foxit Reader (free version) in Windows. Open your PDF file, Ctrl+P to print, Select the mode name "Microsoft Print to PDF". Select the path to save new PDF file. Upload this PDF file to arXiv.
0
https://tex.stackexchange.com/users/190270
692092
321,059
https://tex.stackexchange.com/questions/688346
0
I am somewhat new to LyX, and while I've been using it for long enough to know my way around it, there is one feature about it that is becoming ever more irritating; as a student, I mainly use it for writing math courses and need to do so as fast as possible to keep up with the pace. The crux of the problem is that, as you know, TeX code in the math editor is triggered by the \ character. Unfortunately, I happen to have being French as a hobby, and consequently my keyboard layout is the standard French one. Turns out, whoever chose \ as the standard character for writing code very much did NOT have french people in mind, as its position on French keyboards is absolutely atrocious. Should you want to know, it is written by the combination AltGr + 8 (Alt Gr being a key just to the right of the spacebar, in case your keyboard doesn't feature it). That is to say, to type every single TeX command, I have to stretch out my right hand as much as possible, while blocking my thumb under the center of my palm. It's awkward, it makes me lose absurd amounts of time, and brings me physical pain due to carpal tunnel syndrom; in short, I hate it with a burning passion (try it, you'll see what I mean). Which is why I would like to know if there is a way to type \ with some shortcut of my choice, and still have LyX behave as if I typed it as usual. I have tried modifying my .bind files to achieve that, but to no avail; it seems that, while it would be very easy to do with any other character, the unique status of \ (including in .bind files) won't let me do it. `\bind "<My-Shortcut>" "insert-unicode 0x005C"` gave me hope for a few seconds, as it does type \ in text mode, but sadly, it doesn't do anything in math mode. `\bind "<My-Shortcut>" "math-insert \\\"` prints [\"] in math mode for some reason, which is progress, but not really interesting because of the double quotes (I'm not sure where those come from). The same instruction, with any other number of backslashes, or with 3 but without the final double quotes, only creates an empty math editor box. Lastly, I would like to mention that changing the language of my keyboard (with Shift+Alt for example) is not really a valid option; admittedly, \ is very conveniently placed on english keyboards, but 1- I would still be writing in French, so I need to have access to accents and 2- my actual, physical keyboard would still be in French, so I would have to memorize the entire english layout which doesn't sound like I'd be saving time. This being the situation, do you know of any way to achieve that? Thank you very much for your help in advance!
https://tex.stackexchange.com/users/298794
How to bind "\" to another key in LyX?
false
The LFUN called `ert-insert` inserts an ERT inset while in the text editor, but in the math editor it starts a macro (inserts `\` to the editor). The default bind of this LFUN is `ctrl+L` (or `command+L`). Note that there is a LFUN for inserting text, it is called `self-insert`, but for security reasons you can't bind it.
0
https://tex.stackexchange.com/users/264024
692101
321,062
https://tex.stackexchange.com/questions/257147
14
I've seen somebody asked this question a year ago, but no answers given so I'm hoping this might attract some more/new/different attention. Simple question. I want to use LaTeX with Inkscape on mac. I already use a tex editor so I should have most of the LaTeX stuff I need. However when I go to "Extensions>Render>", there's not a LaTeX option there as other online sources suggest. As a fudge I tried using the application Latexit to generate SVG/EPS images to import but I can't seem to get import of those to work either.
https://tex.stackexchange.com/users/82643
How to use LaTeX with Inkscape (MAC OS X)
false
I just tested to run the following code in **terminal** on **Mac OS Ventura** using **inkscape version 1.3**. ``` open -a /Applications/inkscape.app/ ``` The LaTeX rendering and function plot rendering all worked as intended. If you use inkscape frequently, you can save time by creating the **alias** for the command above in **terminal**. --- **Step 1:** Determine which shell you are using. Common ones are `bash` and `zsh`. You can check by running: ``` echo $SHELL ``` --- **Step 2:** Open appropriate shell configuration. For `bash`, enter `nano ~/.bashrc`. For `zsh`, enter `nano ~/.zshrc`. --- **Step 3:** Create the alias. ``` alias inkscape="open -a /Applications/inkscape.app" ``` To save the alias, you can press **Ctrl + X**, then **Y** to save the changes. --- **Step 4:** To apply the changes to your current terminal session, run the following command. For `bash`, `source ~/.bashrc`. For `zsh`, `source ~/.zshrc`. --- Finally, you can open the inkscape with `pdflatex` and function plotting functioning well in **terminal** by just type the key word alias `inkscape` to open the inkscape application.
0
https://tex.stackexchange.com/users/287315
692104
321,064
https://tex.stackexchange.com/questions/48018
23
I am using texmaker on a Mac and I tired to use the minted package with this code ``` \documentclass[12pt,A4]{article} \usepackage{minted} \begin{document} \begin{minted}{python} def __init__(self, x, y): self.x=x self.y=y \end{minted} \end{document} ``` but when compiling my code I get the following error: ``` ! Package minted Error: You must have `pygmentize' installed to use this package ``` However I actually did install the package as described using ``` sudo easy_install Pygments ``` I even tried restarting. Still getting the same error. I really don't see how to fix this error, can someone help me? When creating the pdf as suggested by egreg the resulting pdf looks like this: ``` /Library/Frameworks/Python.framework/Versions/2.7/bin /opt/local/bin /opt/local/sbin /opt/local/bin /opt/local/sbin /usr/bin /bin /usr/sbin /sbin /usr/local/bin /usr/texbin /usr/X11/bin Is there pygmentize? /Library/Frameworks/Python.framework/Versions/2.7/bin/pygmentize ``` Judging from that there is Pygmentize on my mac?!
https://tex.stackexchange.com/users/12620
minted not working on mac
false
Use `which pygmentize` to find the path for **pygmentize** first in **Mac OS terminal**, and then copy it to `/usr/local/bin`.
0
https://tex.stackexchange.com/users/287315
692109
321,066
https://tex.stackexchange.com/questions/692115
0
I use Texmaker with MikTex, and I am writing a file where I use a logo image as a background for the first page. I put a folder (with name: data) in the same working directory, inside which the logo is located. Strangely, other than importing the image from that folder, latex is importing a strange image from <<**C:\Users\someone\AppData\Local\Programs\MiKTeX\tex\latex\beautybook\inner\_pics**>>. Any explanations or solutions? The piece of code ``` \documentclass[12pt]{article} \usepackage{graphicx} \graphicspath{ data } \usepackage[firstpage=true]{background} \usepackage{fancyhdr} % Needed to define custom headers/footers \usepackage[margin=1in]{geometry} \usepackage[english]{babel} \usepackage{fancyvrb} \makeatletter \AtBeginDocument{% \expandafter\renewcommand\expandafter\subsection\expandafter {\expandafter\@fb@secFB\subsection}% \newcommand\@fb@secFB{\FloatBarrier \gdef\@fb@afterHHook{\@fb@topbarrier \gdef\@fb@afterHHook{}}}% \g@addto@macro\@afterheading{\@fb@afterHHook}% \gdef\@fb@afterHHook{}% } \makeatother \usepackage{url} \newcommand{\bibTitle}[1]{``#1''} \setlength\parindent{0pt} % Gets rid of all indentation \backgroundsetup{contents={\includegraphics[width=\textwidth]{logo.png}},scale=0.5,placement=top,opacity=1,position={7.2cm,2cm}} % Logo \pagestyle{fancy} % Enables the custom headers/footers \lhead{} \rhead{} % Headers - all empty \title{\normalfont \normalsize \textsc{School of \\ Report} \\ [10pt] \rule{\linewidth}{0.5pt} \\[8pt] \huge Title \\ \rule{\linewidth}{2pt} \\[10pt] } \author{Name \\ ID } \date{\normalsize Submitted on Jul. 27\textsuperscript{th}} \begin{document} \maketitle \section*{Abstract} \end{document} ```
https://tex.stackexchange.com/users/301435
Different Picture is imported in the pdf
false
MikTex was importing a picture from ***inner\_pics*** folder, but using `\includegraphics{./picture.png}` other than `\includegraphics{picture.png}` as commented by **UlrikeFischer** solved the problem.
0
https://tex.stackexchange.com/users/301435
692116
321,067
https://tex.stackexchange.com/questions/692115
0
I use Texmaker with MikTex, and I am writing a file where I use a logo image as a background for the first page. I put a folder (with name: data) in the same working directory, inside which the logo is located. Strangely, other than importing the image from that folder, latex is importing a strange image from <<**C:\Users\someone\AppData\Local\Programs\MiKTeX\tex\latex\beautybook\inner\_pics**>>. Any explanations or solutions? The piece of code ``` \documentclass[12pt]{article} \usepackage{graphicx} \graphicspath{ data } \usepackage[firstpage=true]{background} \usepackage{fancyhdr} % Needed to define custom headers/footers \usepackage[margin=1in]{geometry} \usepackage[english]{babel} \usepackage{fancyvrb} \makeatletter \AtBeginDocument{% \expandafter\renewcommand\expandafter\subsection\expandafter {\expandafter\@fb@secFB\subsection}% \newcommand\@fb@secFB{\FloatBarrier \gdef\@fb@afterHHook{\@fb@topbarrier \gdef\@fb@afterHHook{}}}% \g@addto@macro\@afterheading{\@fb@afterHHook}% \gdef\@fb@afterHHook{}% } \makeatother \usepackage{url} \newcommand{\bibTitle}[1]{``#1''} \setlength\parindent{0pt} % Gets rid of all indentation \backgroundsetup{contents={\includegraphics[width=\textwidth]{logo.png}},scale=0.5,placement=top,opacity=1,position={7.2cm,2cm}} % Logo \pagestyle{fancy} % Enables the custom headers/footers \lhead{} \rhead{} % Headers - all empty \title{\normalfont \normalsize \textsc{School of \\ Report} \\ [10pt] \rule{\linewidth}{0.5pt} \\[8pt] \huge Title \\ \rule{\linewidth}{2pt} \\[10pt] } \author{Name \\ ID } \date{\normalsize Submitted on Jul. 27\textsuperscript{th}} \begin{document} \maketitle \section*{Abstract} \end{document} ```
https://tex.stackexchange.com/users/301435
Different Picture is imported in the pdf
false
Your `\graphicspath` setting is false, you need an additional brace and can also add a slash at the end (but it works for me also without it). But the main point is to understand the search order: The code will at first use `kpsewhich` to search for the image and only if this fail check the pathes given by `\graphicspath`. That means that pictures in the current folder and in the texmf tree are found first and so preferred. You can disable matches from the texmf tree by prepending `./` to the name. So ``` \documentclass{article} \usepackage{graphicx} \graphicspath{{chapters/}} \begin{document} \includegraphics{example-image} \includegraphics{./example-image} \includegraphics{chapters/example-image} \includegraphics{sub} \end{document} ``` will find (assuming that I have example-image in the chapters folder) ``` <c:/texlive/2022/texmf-dist/tex/latex/mwe/example-image.pdf> <./chapters//./example-image.pdf> <./chapters/example-image.pdf> <./chapters/sub.pdf> ```
1
https://tex.stackexchange.com/users/2388
692119
321,069
https://tex.stackexchange.com/questions/663415
0
The standard line integral is identical to the normal integral, so often times the "C" is put under it like this: ``` \int_C ``` And for the line integral with limits of integration: ``` \int_{a}^{b} ``` However, I want my students to still know that it is a line integral, so I would like to keep the "C" in addition to the limits of integration. The problem is that I cannot find a way to do so. I have tried experimenting with `\limits` but that does not work either. Here are some of my attempts: `\int_C \limits_{a}^{b}` (I really thought this one was going to work.) Is there any way to keep the "C" with the limits? I appreciate all responses :)
https://tex.stackexchange.com/users/278102
How to include the "C" under a line integral while still keeping the limits of integration?
false
Sorry, but I believe you're trying to deceive your students. A line integral over the curve *C* *can* be computed as an ordinary integral once you know a parameterization of the curve; but in the latter integral there's no remaining explicit trace of the curve *C*. Anyway, this should do what you want. Note the name I gave to the command. ``` \documentclass{article} \usepackage{mathtools} \newcommand{\badint}[1]{% \mathop{\mathrlap{\mathop{\vphantom{\int}}\limits_{\!#1}}}% \!% \int } \begin{document} \[ \int_C f(z)\,dz = \badint{C}_{a}^{b} f(\varphi(t))\varphi'(t)\,dt \] \[ \int_C f(z)\,dz = \int_{a}^{b} f(\varphi(t))\varphi'(t)\,dt \] \end{document} ```
1
https://tex.stackexchange.com/users/4427
692121
321,070
https://tex.stackexchange.com/questions/692122
2
I'd like to have a numbered list of marginal query-markers. My attempt (below) correctly gives marginal marks ???1 and ???2, but the increment within the itemize environment seems to get lost, and the next query is also tagged ???2. ``` \documentclass{report} \newcount\countahhqqq \countahhqqq=0 \def\QQ{ \advance \countahhqqq by 1 \marginpar{\bf ???\number\countahhqqq}} \begin{document} Here I raise a question\QQ and get a numbered marginal note. Now in an itemize environment \begin{itemize} \item I'm happy here \item but less so here\QQ \end{itemize} which leaves me wondering what's gone wrong.\QQ \end{document} ```
https://tex.stackexchange.com/users/301436
Behaviour of counters
false
The change in counter values is local to the scope, so resets after `itemize`. The workaround is to precede your counter advancement with `\global`: ``` \global\advance \countahhqqq by 1 ``` This is what LaTeX does naturally when defining and stepping counters via `\newcounter` and `\stepcounter`. ``` \documentclass{article} %\newcount\countahhqqq %\countahhqqq=0 %\def\QQ{\global\advance \countahhqqq by 1 \marginpar{\bf ???\number\countahhqqq}} \newcounter{countahhhqqq} \newcommand{\QQ}{\stepcounter{countahhhqqq}\marginpar{\bfseries ???\thecountahhhqqq}} \begin{document} Here I raise a question\QQ{} and get a numbered marginal note. Now in an itemize environment \begin{itemize} \item I'm happy here \item but less so here\QQ \end{itemize} which leaves me wondering what's gone wrong.\QQ \end{document} ```
3
https://tex.stackexchange.com/users/5764
692125
321,071
https://tex.stackexchange.com/questions/692124
2
I try to set the color of a cell in a `tabularray` by a command: ``` \documentclass{article} \usepackage{xcolor} \usepackage{tabularray} \ExplSyntaxOn \newcommand{\Tcolor}{ green } \ExplSyntaxOff \begin{document} \textcolor{\Tcolor}{abc} \begin{tblr}{ colspec = {l}, cell{1}{1} = {\Tcolor}, } abc \\ \end{tblr} \end{document} ``` Somehow the color `cell{1}{1} = {\Tcolor},` breaks. Why? `cell{1}{1} = {green},` works... EDIT: I guess in my attempt to create a MWE I shortened it too much. There is a need for a function instead of a simple color: ``` \documentclass{article} \usepackage{xcolor} \usepackage{tabularray} \ExplSyntaxOn \newcommand{\Tcolor}[1]{ \int_compare:nNnTF {#1} = {0} { red } { \int_compare:nNnTF {#1} < {30} { orange } { \int_compare:nNnTF {#1} < {40} { green } { blue } } } } \ExplSyntaxOff \begin{document} \textcolor{\Tcolor{32}}{abc} \begin{tblr}{ colspec = {l}, cell{1}{1} = {\Tcolor{32}}, cell{1}{2} = {\Tcolor{48}}, } abc \\ def \\ \end{tblr} \end{document} ```
https://tex.stackexchange.com/users/281557
Why does tabularray not accept colors from commands?
true
The `cell{<i>}{<j>}` key can accept several types of values; for instance, according to the manual, you can do ``` cell{1}{1}={cmd=\fbox} ``` Thus the managing of values is necessarily complex. When a value is just a string that's not another key, it is interpreted as a color name for the background. You can use `bg=<color>` and, in this case, you can use a macro. ``` \documentclass{article} \usepackage{xcolor} \usepackage{tabularray} \ExplSyntaxOn \NewExpandableDocumentCommand{\Tcolor}{m} { \bool_case:nF { { \int_compare_p:n {#1 = 0} }{ red!80 } { \int_compare_p:n {0 < #1 < 30} }{ orange } { \int_compare_p:n {30 <= #1 < 40} }{ green!80 } } { blue!60!green } } \ExplSyntaxOff \begin{document} \textcolor{\Tcolor{32}}{abc} \medskip \begin{tblr}{ colspec = {l}, cell{1}{1} = {bg=\Tcolor{0}}, cell{2}{1} = {bg=\Tcolor{15}}, cell{3}{1} = {bg=\Tcolor{32}}, cell{4}{1} = {bg=\Tcolor{48}}, } abc \\ def \\ ghi \\ jkl \\ \end{tblr} \end{document} ``` Note the use of `\bool_case:nF` in order to avoid the awkward nesting of conditionals.
3
https://tex.stackexchange.com/users/4427
692131
321,074
https://tex.stackexchange.com/questions/692129
4
I have a trouble writing a mathematical mapping inside a box written with the \begin{tabular} environment. The map is denoted by · (a dot) and goes from GxG to G (is closed). I'm trying to write the following text inside a table, like this: ``` \begin{tabular}{| c |} \hline \begin{align*} \cdot \ : \ G \times G & \longmapsto G (g,h) & \longmapsto g \cdot h = gh \end{align*}\\ \hline \end{tabular} ``` This gives some kind of error when I write the & separator and I don't know why. How can I write this mapping inside my table?
https://tex.stackexchange.com/users/301440
Writing a map in Latex
false
You cannot use `align*` in a table cell. You can instead use `aligned`, but `tabular` is not needed. ``` \documentclass{article} \usepackage{amsmath} \begin{document} \[ \boxed{ \begin{aligned} {\cdot} : G \times G & \longrightarrow G \\ (g,h) & \longmapsto g \cdot h = gh \end{aligned} } \] \end{document} ```
8
https://tex.stackexchange.com/users/4427
692132
321,075
https://tex.stackexchange.com/questions/692095
1
I have a LaTeX-Project that is split into multiple files using the package `subfiles`. The project has the following structure: ``` main.tex .latexmkrc lib/custom-class.cls lib/custom-package.sty foo/bar.tex foo/image.png baz/... ``` I use `latexmkrc` to include the class- and package-files in `lib` in `TEXINPUTS`: ``` ensure_path( 'TEXINPUTS', 'lib//' ) ``` The project builds correctly when I build `main.tex`, but when I build one of the subfiles (e.g. `for/bar.tex`) I get the error ``` File `custom-class.cls` not found. ``` I realise this is because `.latexmkrc` is not used when building in a subdirectory. I found a [discussion](https://github.com/James-Yu/LaTeX-Workshop/issues/1895) on the GitHub-Page of the VSCode-extension LaTeX-Workshop (which I am using) and the best solution there seems to be to just copy and paste `.latexmkrc` into the subdirectories – the issue is that I have many (20 or so) subdirectories and I want to avoid having to change all these files whenever I change the main `.latexmkrc`, especially since I am not the only one working on this project. Is there any other way, or can I, perhaps, create a `.latexmkrc` in each of the subdirectories that just imports the main `.latexmkrc`? Thanks for any pointers.
https://tex.stackexchange.com/users/269090
latexmkrc and subfiles
true
Try adding the following lines at the very beginning of the main file: ``` \makeatletter \def\input@path{{lib/}{../lib/}} \makeatother ``` This sets the input path to the directories where to search for additional files, from both perspectives (main directory and subfolder `foo`). I tested this approach with the following sample project: ``` % main.tex \makeatletter \def\input@path{{lib/}{../lib/}} \makeatother \documentclass{custom-class} \usepackage{custom-package} \usepackage{graphicx} \usepackage{subfiles} \begin{document} \subfile{foo/bar.tex} \end{document} % foo/bar.tex \documentclass[../main]{subfiles} \begin{document} \includegraphics[width=2cm]{image.png} \end{document} % cp `kpsewhich example-image.png foo/image.png` % lib/custom-class.cls \LoadClass{article} % lib/custom-package.sty \endinput ```
1
https://tex.stackexchange.com/users/110998
692133
321,076
https://tex.stackexchange.com/questions/692140
4
Currently, I want to define a command that makes it easy for me to write the usual notation for a set in set theory. Using the `\newcommand` command, I was able to define the following: ``` \documentclass{article} \usepackage{ifthen} \usepackage{calc} \usepackage{amsmath,amssymb,mathtools} \usepackage{xcolor} \newcommand{\TCConjunto}[2]{% \ifthenelse{\equal{#1}{}\AND\equal{#2}{}}% {\varnothing}% {\ifthenelse{\equal{#1}{}}% {\{#2\}}% {\ifthenelse{\equal{#2}{}}% {\{#1\}}% {\{#1\,:\,#2\}}% }% }% }% %%----- \newcommand{\TCUnion}[2]{% \ifthenelse{\equal{#1}{}\AND\equal{#2}{}}% {\varnothing}% {\ifthenelse{\equal{#1}{}}% {#2}% {\ifthenelse{\equal{#2}{}}% {#1}% {#1\cup #2}% }% }% }% \begin{document} \section{Introduction} $\TCConjunto{}{}$ $\TCConjunto{A,B,C}{}$ $\TCConjunto{}{A,B,C}$ $\TCUnion{}{}$ $\TCUnion{A}{}$ $\TCUnion{}{B}$ $\TCUnion{A}{B}$ %%%%%%$\TCUnion{A}{\TCUnion{B}{C}}$ \end{document} ``` The commands I just mentioned work with "simple" parameters. In a line of code, I've used the `%` symbol to highlight a problem; when I try to nest one of those commands with itself it throws an error. Could you help me figure out the problem?
https://tex.stackexchange.com/users/301449
Can I nest the \newcommand command with itself?
true
I've never been a user of the `ifthen` package, but I'm quite partial to using plain TeX conditionals. With these conditionals, you can nest `\TCConjunto` and `\TCUnion` as much as you want. ``` \documentclass{article} \usepackage{amssymb} \newcommand{\TCConjunto}[2]{ \if\relax\detokenize{#1}\relax \if\relax\detokenize{#2}\relax \varnothing% \else \{#2\}% \fi \else \if\relax\detokenize{#2}\relax \{#1\}% \else \{#1\,:\,#2\}% \fi \fi } %%----- \newcommand{\TCUnion}[2]{ \if\relax\detokenize{#1}\relax \if\relax\detokenize{#2}\relax \varnothing% \else #2% \fi \else \if\relax\detokenize{#2}\relax #1% \else #1\cup#2% \fi \fi } \begin{document} \section{Introduction} \setlength{\parindent}{0pt} % to make the screenshot look prettier $\TCConjunto{}{}$ $\TCConjunto{A,B,C}{}$ $\TCConjunto{}{A,B,C}$ $\TCConjunto{A}{B}$ $\TCUnion{}{}$ $\TCUnion{A}{}$ $\TCUnion{}{B}$ $\TCUnion{A}{B}$ $\TCUnion{\TCUnion{A}{\TCUnion{B}{\TCConjunto{C}{D}}}}{E}$ \end{document} ```
4
https://tex.stackexchange.com/users/91603
692149
321,082
https://tex.stackexchange.com/questions/692150
2
I am using the AIP.bst style file that is the first result from a Google search. I'm trying to cite a book, but the book is not appearing in AIP style. In the references section, it is appearing as, > > M. E. Peskin and D. V. Schroeder, An Introduction to Quantum Field Theory, CRC > Press, Boca Raton, 2019. > > > However, according to the AIP style guide, <https://guides.lib.vt.edu/find/citation-style-manuals/aip>, it should look like this, > > M. E. Peskin and D. V. Schroeder, An Introduction to Quantum Field Theory, (CRC > Press, Boca Raton, 2019). > > > I have no idea how to edit the AIP.bst file; it seems like gibberish. All that I want to do is have the parentheses surround the publisher and year like it does in the style guide. Can anyone make a suggestion about what to do?
https://tex.stackexchange.com/users/163404
Bibtex Not Generating Correct Reference AIP Style
false
`aip.bst` is not the correct bibtex style file. If you are submitting to an AIP journal, you should use `revtex` which loads the correct bibtex file. AIP has [even published templates for Overleaf](https://publishing.aip.org/resources/researchers/author-instructions/#latex). If you, for some reason, just want to use the AIP bibliography styles, the one that revtex loads is either `aipnum4-2.bst` or `aipnum4-1.bst` (depending whether you are basing it on `revtex4.1` or `revtex4.2`). Both can be found on CTAN.
1
https://tex.stackexchange.com/users/119
692154
321,084
https://tex.stackexchange.com/questions/692158
0
I would like to give additional information in the table of contents, but not have that information appear as a section title in the body of the document. Is there a way to manually insert entries in the TOC? In the example below, I'd like the "subsubsection"s called "Diet" and "Migration" to appear in my table of contents, but not to appear in the document itself (so that "Often, people. No Need" is listed under the subsection "Brown", and there is no interruption with section titles). ``` \documentclass[12pt, letterpaper]{article} \begin{document} \tableofcontents \section{Bears} They're large. \subsection{Brown} Also called Grizzly. \subsubsection*{Diet} Often, people. \subsubsection*{Migration} No need. \end{document} ```
https://tex.stackexchange.com/users/226570
Add a subsection to TOC without having titles appear in body
true
Try something like `\addcontentsline{toc}{subsubsection}{Diet}` at the appropriate place.
1
https://tex.stackexchange.com/users/26614
692159
321,086
https://tex.stackexchange.com/questions/692167
3
In LaTeX I declared a **`\NewDocumentCommand`** like this: ``` \NewDocumentCommand{\DeclareListOfValues}{ m m } { \clist_gclear_new:c {g_list_of_values_#1_clist} \clist_gset:cn {g_list_of_values_#1_clist} {#2} } ``` Here's an example on how I'm using it to create nested lists of values: ``` \DeclareListOfValues{MyList} { {14-1-11,73.6,26.4,0,0,0}, {15-1-4,72.7,27.3,0,0,0}, {15-1-6,67.7, 32.3,0,0,0}, {16-1-10,75.6, 24.4,0,0,0}, {1562-3-6,68.7,31.3,0,0,0}, {1562-3-16,71.6,28.4,0,0,0}, {1563-3-8,85.9,14.1,0,0,0}, {1563-3-13,71.8,28.2,0,0,0}, {1564-2-7,58.1,41.9,0,0,0}, {1564-3-14,56.2,43.8,0,0,0} } ``` From this values inside the nested lists I automatically create histograms and that works perfectly fine. **What I need to accomplish now is counting the sublists within the list as well as the elements within the sublists, because this numbers can be different.** Can anybody help, please? Br, Mic
https://tex.stackexchange.com/users/233991
How to count elements stored within a list
true
This provides a fully expandable command for counting either the items of the outer list or the items in a sublist thereof. ``` \documentclass{article} \ExplSyntaxOn \NewDocumentCommand{\DeclareListOfValues}{ m m } { \clist_gclear_new:c {g_list_of_values_#1_clist} \clist_gset:cn {g_list_of_values_#1_clist} {#2} } \NewExpandableDocumentCommand{\CountList}{om} { \IfNoValueTF { #1 } {% no optional argument, count the outer list \clist_count:c {g_list_of_values_#2_clist} } {% optional argument, count the i-th item in the outer list \clist_count:e { \clist_item:cn {g_list_of_values_#2_clist} { #1 } } } } \cs_generate_variant:Nn \clist_count:n { e } \ExplSyntaxOff \DeclareListOfValues{MyList}{ {14-1-11,73.6,26.4,0,0,0}, {15-1-4,72.7,27.3,0,0,0}, {15-1-6,67.7, 32.3,0,0,0}, {16-1-10,75.6, 24.4,0,0,0}, {1562-3-6,68.7,31.3,0,0,0}, {1562-3-16,71.6,28.4,0,0,0}, {1563-3-8,85.9,14.1,0,0,0}, {1563-3-13,71.8,28.2,0,0,0}, {1564-2-7,58.1,41.9,0,0,0}, {1564-3-14,56.2,43.8,0,0,0} } \begin{document} \CountList{MyList} (should be 10) \CountList[1]{MyList} (should be 6) \end{document} ``` It's possible, if requested, to add a check whether the optional argument is outside the admissible range.
5
https://tex.stackexchange.com/users/4427
692168
321,092
https://tex.stackexchange.com/questions/692140
4
Currently, I want to define a command that makes it easy for me to write the usual notation for a set in set theory. Using the `\newcommand` command, I was able to define the following: ``` \documentclass{article} \usepackage{ifthen} \usepackage{calc} \usepackage{amsmath,amssymb,mathtools} \usepackage{xcolor} \newcommand{\TCConjunto}[2]{% \ifthenelse{\equal{#1}{}\AND\equal{#2}{}}% {\varnothing}% {\ifthenelse{\equal{#1}{}}% {\{#2\}}% {\ifthenelse{\equal{#2}{}}% {\{#1\}}% {\{#1\,:\,#2\}}% }% }% }% %%----- \newcommand{\TCUnion}[2]{% \ifthenelse{\equal{#1}{}\AND\equal{#2}{}}% {\varnothing}% {\ifthenelse{\equal{#1}{}}% {#2}% {\ifthenelse{\equal{#2}{}}% {#1}% {#1\cup #2}% }% }% }% \begin{document} \section{Introduction} $\TCConjunto{}{}$ $\TCConjunto{A,B,C}{}$ $\TCConjunto{}{A,B,C}$ $\TCUnion{}{}$ $\TCUnion{A}{}$ $\TCUnion{}{B}$ $\TCUnion{A}{B}$ %%%%%%$\TCUnion{A}{\TCUnion{B}{C}}$ \end{document} ``` The commands I just mentioned work with "simple" parameters. In a line of code, I've used the `%` symbol to highlight a problem; when I try to nest one of those commands with itself it throws an error. Could you help me figure out the problem?
https://tex.stackexchange.com/users/301449
Can I nest the \newcommand command with itself?
false
If it's not too late to change syntax, I advocate an optional argument for `\TCConjunto` ``` \documentclass{article} \usepackage{amsmath} \NewDocumentCommand{\TCConjunto}{om}{% \IfNoValueTF{#1}{% \IfBlankTF{#2}{\emptyset}{\{#2\}} }{\{#1:#2\}}% } \NewDocumentCommand{\TCUnion}{mm}{% \IfBlankTF{#1}{% \IfBlankTF{#2}{\emptyset}{#2}% }{% \IfBlankTF{#2}{#1}{#1\cup#2}% }% } \begin{document} $\TCConjunto{}$ $\TCConjunto{A,B,C}$ $\TCConjunto[x]{x\notin x}$ $\TCUnion{}{}$ $\TCUnion{A}{}$ $\TCUnion{}{B}$ $\TCUnion{A}{B}$ $\TCUnion{A}{\TCUnion{B}{C}}$ \end{document} ``` Sorry for `\emptyset`, but my eyes bleed when I see the plumber's symbol `\varnothing` used for the empty set. With `\IfNoValueTF` we check whether the optional argument is present; with `\IfBlankTF` we check whether the supplied argument is empty (better, consists only of zero or more blank spaces).
3
https://tex.stackexchange.com/users/4427
692171
321,095
https://tex.stackexchange.com/questions/687546
1
How can I suppress the links to the last page on each page? Consider the following example: ``` \documentclass[colorlinks]{moderncv} \usepackage{lipsum} \name{}{} \begin{document} \lipsum \end{document} ``` Here we have the page numbering 1/2 and 2/2, but the last 2 is marked red because it is a link. How can I suppress the behavior so that I have 1/2 and 2/2 only?
https://tex.stackexchange.com/users/136549
moderncv: suppress links to last page
false
You can simply add something like ``` \fancyfoot[r]{\color{color2}\pagenumberfont\strut\thepage/\pageref*{lastpage}} ``` after your `\begin{document}` line. The `*` after the `\pageref` will only print the page number, without a link.
0
https://tex.stackexchange.com/users/113611
692175
321,097
https://tex.stackexchange.com/questions/437447
2
I know about `\newcommand[<arg_num>]{#1 ... #n}` to define a simple macro with up to nine arguments. (More if you link multiple `newcommands` together) I recently started to look at `xparse` for some additional features such as multiple optional arguments, as well as `keyval` -- which works as I want it to, as long as each option is just one keyword. What I would ultimately like to have is a way to address certain options by name and assign values and strings like so: ``` \MyCommand[ opt1="this is val1", opt4="this is val4", optN="this is valN" ]{argument1} ``` Or maybe even: ``` \MyCommand{ arg1="this is val1", arg4="this is val4", argN="this is valN" } ``` (I know that `"this is val"` is not LaTeX syntax, maybe `{this is val}`?) I am still fairly new to LaTeX, and I am not sure how to properly search for this. So I hope someone here can point me in the right direction.
https://tex.stackexchange.com/users/165511
Custom command with addressable arguments
false
You can use `expkv-cs` and its hashing variants. With this the setup is absolutely straight forward. The resulting macro will be fully expandable. Just to mention it the following code also includes the splitting variant of `expkv-cs` with which the key-values are accessible as positional parameters. ``` \documentclass{article} \usepackage{expkv-cs} % splits the keys into separate arguments to be referred by #1...#9 \ekvcSplit\mymacroA { argA = ARG-A ,argB = argB ,argC = A-R-G--C ,a long key name with spaces = a long value with spaces } {Arguments: #1/#2/#3/#4} % stores all keys into #1 (in a way they can be accessed pretty fast), so we can % access them by names. % \ekvcValue will need exactly two steps of expansion. \ekvcHash\mymacroB { argA = ARG-A ,argB = argB ,argC = A-R-G--C ,a long key name with spaces = a long value with spaces } {% Arguments: \ekvcValue{argA}{#1}/% \ekvcValue{argB}{#1}/% \ekvcValue{argC}{#1}/% \ekvcValue{a long key name with spaces}{#1}% } \begin{document} \mymacroA{}\par \mymacroB{}\par \mymacroB{argC=ccc, a long key name with spaces = a b c} \end{document} ```
0
https://tex.stackexchange.com/users/117050
692187
321,104
https://tex.stackexchange.com/questions/692183
0
In a diagram made with Ti*k*Z, I saw this coordinate relative to the node “c”: `(c.130)`, 130 being an angle in degrees. Can someone tell me why the distance between the two points obtained is not specified? What is this distance? What Ti*k*Z instruction is this taken from? Thanks in advance. ``` \documentclass[border=0.2cm]{standalone} \usepackage{tikz} \begin{document} \begin{tikzpicture} \node(c){$\bullet$}; \draw(c.130) node[red]{$\bullet$}; \end{tikzpicture} \end{document} ```
https://tex.stackexchange.com/users/228936
TikZ coordinate
true
Looks like the guess made by @anis is right: * `\node[draw=gray!20](c){$\bullet$};` puts a tight rectangle (default shape) around this node * `\draw(c.130) node[red]{$\bullet$};` is a polar reference from (c) at 130deg ON the default shape; replacing the `.` with `:` results in a compile error * for reference, `\draw(c.west) node[orange]{$\bullet$};` puts an orange dot on the nodes shape * for reference, `\draw[blue!50] (0,0) -- (25:2);` draws a blue line at 25deg 2cm apart ``` \documentclass[border=0.2cm]{standalone} \usepackage{tikz} \begin{document} \begin{tikzpicture} \node[draw=gray!20](c){$\bullet$}; \draw(c.130) node[red]{$\bullet$}; \draw(c.west) node[orange]{$\bullet$}; \draw[blue!50] (0,0) -- (25:2); \end{tikzpicture} \end{document} ``` For reference, here's the same code but with `inner sep=7mm` for the node, making the default shape larger: ``` \begin{tikzpicture} \node[draw=gray!20,inner sep=7mm](c){$\bullet$}; \draw(c.130) node[red]{$\bullet$}; \draw(c.west) node[orange]{$\bullet$}; \draw[blue!50] (0,0) -- (25:2); \end{tikzpicture} ```
2
https://tex.stackexchange.com/users/245790
692191
321,106
https://tex.stackexchange.com/questions/692183
0
In a diagram made with Ti*k*Z, I saw this coordinate relative to the node “c”: `(c.130)`, 130 being an angle in degrees. Can someone tell me why the distance between the two points obtained is not specified? What is this distance? What Ti*k*Z instruction is this taken from? Thanks in advance. ``` \documentclass[border=0.2cm]{standalone} \usepackage{tikz} \begin{document} \begin{tikzpicture} \node(c){$\bullet$}; \draw(c.130) node[red]{$\bullet$}; \end{tikzpicture} \end{document} ```
https://tex.stackexchange.com/users/228936
TikZ coordinate
false
Your first point (`bullet`) is inside a `node` for which you didn't define any size or shape, so it's adjusted to its content (the bullet) and has the default rectangular shape. Then, by `\draw(c.130) node[red]{$\bullet$};` you place another node on the edge of this first node, but at 130°. See the code below (with a larger `inner sep` to help you visualize it). I added the parameter `draw` to the nodes on the edges, just to make you understand the way it's placed and drawn. If you just want to draw a filled circle, you'll have to do this differently. On a rectangluar shaped first node: On a circular shaped node: ``` \documentclass[tikz,border=3.14mm]{standalone} \begin{document} \begin{tikzpicture} \node[draw=cyan,inner sep=10mm](c){$\bullet$}; \foreach \angle [evaluate = \angle as \shad using \angle+10] in {0,30,60,90} \draw(c.\angle) node[draw,blue!\shad]{$\bullet$}; \draw(c.130) node[red]{$\bullet$}; \end{tikzpicture} \begin{tikzpicture} \node[circle,draw=cyan,inner sep=10mm](c){$\bullet$}; \foreach \angle [evaluate = \angle as \shad using \angle+10] in {0,30,60,90} \draw(c.\angle) node[draw,blue!\shad]{$\bullet$}; \draw(c.130) node[red]{$\bullet$}; \end{tikzpicture} \end{document} ```
2
https://tex.stackexchange.com/users/204164
692193
321,107
https://tex.stackexchange.com/questions/692189
2
In my document I would like to include two figures side by side (this part I know how to do it). Below these two figures, I would like to include a long text, in footnote size, which is the translation of the text inside these two figures. The problem is that because the text is very long, the page does not display it and `footnotesize` is not working. Here is my code so far: ``` \documentclass[12pt, times]{article} \usepackage{UF_FRED_paper_style} \begin{document} \begin{figure} \centering \caption{My title} {\includegraphics[width=0.49\textwidth]{fig1.jpeg}} \hfill {\includegraphics[width=0.49\textwidth]{fig2.jpeg}} \textit{Source:} Origin \\ \textit{Translation:} \captionof{\footnotesize{Here I want to add a text with around 20 lines, justified, with the translation of what is inside the figures. But footnotesize is not working. What appears to me is the text with normal size, and it does not show all the text because there is no space for that in the page}} \label{fig1} \end{figure} \end{document} ```
https://tex.stackexchange.com/users/301476
Long text below two figures
true
I cannot see a need for two `\caption` directives -- or, for that matter, one `\caption` and one `\captionof` statement. ``` \documentclass[12pt]{article} %\usepackage{UF_FRED_paper_style} % I don't have this file... \usepackage[demo]{graphicx} % remove 'demo' option in real document \usepackage{newtxtext,newtxmath} % optional: Times Roman text and math fonts \begin{document} \begin{figure}[hp] \caption{Caption uses \texttt{\string\normalsize}}\label{fig1} %% there's no need for a '\centering' directive. \smallskip \includegraphics[width=0.49\textwidth]{fig1}% % no need for 'jpeg' filename extension \hfill \includegraphics[width=0.49\textwidth]{fig2} \smallskip\footnotesize \textit{Source}: Origin. \smallskip \textit{Legend}: Here I add about twenty lines of text, justified, with an explanation of what is shown in the graphs. \verb+\footnotesize+ is working fine. More text in footnotesize. More text in footnotesize. More text in footnotesize. More text in footnotesize. More text in footnotesize. More text in footnotesize. More text in footnotesize. More text in footnotesize. More text in footnotesize. More text in footnotesize. More text in footnotesize. More text in footnotesize. More text in footnotesize. More text in footnotesize. More text in footnotesize. More text in footnotesize. More text in footnotesize. More text in footnotesize. More text in footnotesize. More text in footnotesize. More text in footnotesize. More text in footnotesize. More text in footnotesize. More text in footnotesize. More text in footnotesize. More text in footnotesize. \par \end{figure} A cross-reference to figure \ref{fig1}. \end{document} ```
3
https://tex.stackexchange.com/users/5001
692204
321,110
https://tex.stackexchange.com/questions/692027
3
I want to change angle between edge but unable to do it. Code is given below ``` \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture} [sibling distance=25em, every node/.style = {shape=rectangle, rounded corners, draw, align=center, top color=white, bottom color=blue!20}, ] \node {Body\\ Temperature} child { node {Non\\Mammal} edge from parent [->] node [left] {Cold}} child { node {Give\\ Birth} edge from parent [->] node [right] {Warm} child { node {Mammal}edge from parent [->] node [left] {Yes}} child { node {Non \\ Mammal} edge from parent [->] node [right] {No}}}; \end{tikzpicture} \end{document} ```
https://tex.stackexchange.com/users/301368
How I can set angle between edge in given code?
false
Here is an option using `forest`, which allows you to set the angle for the entire tree using `calign=fixed edge angles, calign angle=<angle>`. The angle (set to 60 in the example below) is the angle between the edge and a vertical line from the parent. You can adjust `l sep` to change the vertical spacing between nodes. Note that `\forestset` rather than `\tikzset` is needed for the main nodes because `forest` vertically aligns nodes differently from `tikz`. ``` \documentclass{article} \usepackage{forest} \forestset{nodestyle/.style={rounded corners, draw, align=center, top color=white, bottom color=blue!20}} \tikzset{labelstyle/.style={midway, rounded corners, draw, align=center, top color=white, bottom color=yellow!20}} \begin{document} \begin{forest} for tree={ nodestyle, l sep=1.2cm, edge={->}, calign=fixed edge angles, calign angle=60 } [Body\\Temperature [Non\\Mammal, edge label={node[labelstyle]{Cold}}] [Give\\Birth, edge label={node[labelstyle]{Warm}} [Non\\Mammal, base=top, edge label={node[labelstyle]{No}}] [Mammal, edge label={node[labelstyle]{Yes}}] ] ] \end{forest} \end{document} ```
1
https://tex.stackexchange.com/users/125871
692208
321,112
https://tex.stackexchange.com/questions/692189
2
In my document I would like to include two figures side by side (this part I know how to do it). Below these two figures, I would like to include a long text, in footnote size, which is the translation of the text inside these two figures. The problem is that because the text is very long, the page does not display it and `footnotesize` is not working. Here is my code so far: ``` \documentclass[12pt, times]{article} \usepackage{UF_FRED_paper_style} \begin{document} \begin{figure} \centering \caption{My title} {\includegraphics[width=0.49\textwidth]{fig1.jpeg}} \hfill {\includegraphics[width=0.49\textwidth]{fig2.jpeg}} \textit{Source:} Origin \\ \textit{Translation:} \captionof{\footnotesize{Here I want to add a text with around 20 lines, justified, with the translation of what is inside the figures. But footnotesize is not working. What appears to me is the text with normal size, and it does not show all the text because there is no space for that in the page}} \label{fig1} \end{figure} \end{document} ```
https://tex.stackexchange.com/users/301476
Long text below two figures
false
There are many ways to put your long text: * unfortunately my suggestion with using `\footnote{}` doesn't work * @Mico 's idea is very nice in my view, to put a legend * `LaTeX` provides many more options for doing so * here I will show a possibility using `tikz` Some comments on my modification of your code: * the `UF_FRED...` package seems to be quite unknown, so I dropped it * package `graphicx` should be used; option `draft` ignores missing images * I used a call to `\tikz{ }` to put the text * inside it just puts one `\node` * nodes need to provide (empty) text like so `{your long text here};` * you can modify the appearance of a node using `[ .. ]` to hold formatting statements * `text width=.8\textwidth` * `font=\small` (or \huge, or \tiny etc.) * `align=center`; see [ch. 17.4.3 for more details in the pgfmanual](https://tikz.dev/tikz-shapes#sec-17.4.3) ``` \documentclass[12pt, times]{article} %\usepackage{UF_FRED_paper_style}% seems to be hardly known \usepackage[draft]{graphicx}% for images; draft puts dummy boxes \usepackage{tikz} \begin{document} \begin{figure} \centering \caption{My title} {\includegraphics[width=0.49\textwidth]{fig1.jpeg}} \hfill {\includegraphics[width=0.49\textwidth]{fig2.jpeg}} \textit{Source:} Origin\\ \textit{Translation:\\ \tikz{ \node[text width=.8\textwidth,font=\small,align=center] {Here I want to add a text with around 20 lines, justified, with the translation of what is inside the figures. But footnotesize is not working. What appears to me is the text with normal size, and it does not show all the text because there is no space for that in the page}% closing \node-text }% closing \tikz }% closing \textit \label{fig1} \end{figure} \end{document} ```
2
https://tex.stackexchange.com/users/245790
692212
321,115
https://tex.stackexchange.com/questions/692215
0
How do `\left |` and `\right |` actually work, specifically when packages like `fontspec` or `mathspec` are involved and unicode fonts are used? I sort of understand how other kinds of brackets and parentheses are constructed from parts in the `U+2300` Unicode block. What glyph is actually used to typeset **vertical bars** in that kind of context? Not `U+007C` or `U+2223`? Or are there some tricks involved? Besides other sources and searches I've tried to look it up in the TeX distro itself, had high hopes for `tex/plain/base`, but - no luck?
https://tex.stackexchange.com/users/210048
How do \left | and \right | actually work?
false
The extension glyphs are specified by the font. Looking at Latin Modern Math ``` \documentclass{article} \usepackage{unicode-math} \showoutput \begin{document} $( \Bigg( \left(\rule{1pt}{1cm}\right.$ \end{document} ``` ``` .......\TU/latinmodern-math.otf(1)/m/n/10 ``` so the large ( come from U+f06cb Private Use area (in this font) and ``` .......\TU/latinmodern-math.otf(1)/m/n/10 ⎛ ......\glue -2.49 plus 2.29002 ......\hbox(4.98+0.0)x8.75, direction TLT .......\TU/latinmodern-math.otf(1)/m/n/10 ⎜ ......\glue -4.98 plus 4.78001 ......\hbox(4.98+0.0)x8.75, direction TLT .......\TU/latinmodern-math.otf(1)/m/n/10 ⎜ ......\glue -4.98 plus 4.78001 ......\hbox(4.98+0.0)x8.75, direction TLT .......\TU/latinmodern-math.otf(1)/m/n/10 ⎜ ......\glue -4.98 plus 4.78001 ......\hbox(4.98+0.0)x8.75, direction TLT .......\TU/latinmodern-math.otf(1)/m/n/10 ⎜ ......\glue -2.49 plus 2.29002 ......\hbox(14.95+0.0)x8.75, direction TLT .......\TU/latinmodern-math.otf(1)/m/n/10 ⎝ ``` so the constructed one is ``` U+239b LEFT PARENTHESIS UPPER HOOK U+239c LEFT PARENTHESIS EXTENSION U+239c LEFT PARENTHESIS EXTENSION U+239c LEFT PARENTHESIS EXTENSION U+239d LEFT PARENTHESIS LOWER HOOK ```
2
https://tex.stackexchange.com/users/1090
692218
321,116
https://tex.stackexchange.com/questions/692215
0
How do `\left |` and `\right |` actually work, specifically when packages like `fontspec` or `mathspec` are involved and unicode fonts are used? I sort of understand how other kinds of brackets and parentheses are constructed from parts in the `U+2300` Unicode block. What glyph is actually used to typeset **vertical bars** in that kind of context? Not `U+007C` or `U+2223`? Or are there some tricks involved? Besides other sources and searches I've tried to look it up in the TeX distro itself, had high hopes for `tex/plain/base`, but - no luck?
https://tex.stackexchange.com/users/210048
How do \left | and \right | actually work?
false
For Latin Modern, one can look at the vertical line `U+007C`. Screenshot from FontForge: Here we can see, that there is the base glyph and then no less than seven variants (`divides.v1`, `divides.v2` and so on, up to `divides.v7`). If one needs larger, there will be a larger, extensible one built with one `divides.bt` at the bottom, one `divides.tp` at the top, and as many `divides.ex` as needed. The recipe on how to glue them together is given there as well, look at the numbers. Other fonts might (will, likely) have a different number of variants, and some might lack an extensible recipe. No guarantees.
1
https://tex.stackexchange.com/users/52406
692219
321,117
https://tex.stackexchange.com/questions/692217
-1
Regardless of the size this double figure takes a whole page, is there a way to prevent this behavior? ``` \documentclass{article} \usepackage{subfigure} \begin{document} \begin{figure} %\begin{adjustwidth}{-1cm}{} \begin{subfigure}{.5\textwidth} \centering \scalebox{0.1}{ \includesvg{dia/layouts/1.svg} } \end{subfigure}% \begin{subfigure}{.5\textwidth} \centering \scalebox{0.13}{ \includesvg{dia/layouts/2.svg} } \end{subfigure} \caption{Left: a caption for the left side, Right: a caption for the right side} \label{fig:long} %\end{adjustwidth} \end{figure} \end{document} ```
https://tex.stackexchange.com/users/299935
Regardless of the size this figure takes a whole page
true
You loaded the obsolete `subfigure` package but used the syntax of `subcaption`, and used `\includesvg` and `\scalebox` with no definition. If I fix those and just use a `\rule` rather than an svg to simplify the example, the figure is set as a top float as expected. ``` \documentclass{article} \usepackage{subcaption} \usepackage{svg} \begin{document} \begin{figure} \begin{subfigure}{.5\textwidth} \centering \scalebox{0.1}{% \rule{10cm}{10cm}%\includesvg{exmple-image.svg}% } \end{subfigure}% \begin{subfigure}{.5\textwidth} \centering \scalebox{0.13}{% \rule{10cm}{10cm}%\includesvg{example-image.svg}% } \end{subfigure} \caption{Left: a caption for the left side, Right: a caption for the right side} \label{fig:long} \end{figure} AaAAA BBBB CCCC AaAAA BBBB CCCC AaAAA BBBB CCCC AaAAA BBBB CCCC AaAAA BBBB CCCC AaAAA BBBB CCCC AaAAA BBBB CCCC AaAAA BBBB CCCC AaAAA BBBB CCCC AaAAA BBBB CCCC AaAAA BBBB CCCC AaAAA BBBB CCCC AaAAA BBBB CCCC AaAAA BBBB CCCC AaAAA BBBB CCCC AaAAA BBBB CCCC AaAAA BBBB CCCC AaAAA BBBB CCCC \end{document} ```
1
https://tex.stackexchange.com/users/1090
692220
321,118
https://tex.stackexchange.com/questions/29236
19
Are there any statistics about the use of LaTeX in the world? In which countries? In which journals/fields of research? Number of articles using LaTeX? etc.?
https://tex.stackexchange.com/users/977
Statistics about LaTeX use in the world
false
> > Total LaTeX usage > > > Although it's an imperfect proxy of LaTeX usage, we can estimate the relative growth of LaTeX along with the growth of the number of Overleaf users: * **2019 March 27:** [4 million users](https://www.overleaf.com/blog/wow-four-million-people-now-use-overleaf) * **2019 November 28:** [5 million users](https://www.overleaf.com/blog/celebrating-over-five-million-users-and-a-quarter-million-daily-actives) * **2020 July 1:** [6 million users](https://www.overleaf.com/blog/reaching-six-million-users-in-an-unprecedented-six-months) * **2021 July 1:** [8 million users](https://www.overleaf.com/blog/eight-million-users) * **2021 December 21**: [9 million users](https://www.overleaf.com/blog/nine-years-nine-million-users) * **2022 June 8**: [10 million users](https://www.overleaf.com/blog/wow-ten-million-users) * **2022 November 23**: [11 million users](https://www.overleaf.com/blog/starting-a-new-era-with-11-million-users-and-100-million-projects) So, Overleaf grows by roughly 2 million users per year, which has a certain sense to it—after all, every year, newly matriculated undergrads and grad students are introduced to LaTeX for the first time, and therefore create new accounts at a more or less constant rate. > > Which countries? > > > There are [**28 TeX user groups**](https://www.ntg.nl/lug/) spread across the world, and Overleaf users account for at least [**189 different countries**](https://www.overleaf.com/blog/wow-ten-million-users). (For comparison, there are 193 nations represented in the UN.) [Similarweb](https://www.similarweb.com/website/tex.stackexchange.com/#geography) gives **23%** of all TeX StackExchange visits as from the **United States**, followed by **8% from Germany** and **6.6% from India**, although there's probably some selection bias because this is an English-speaking site. Overall, it's pretty safe to say that LaTeX is used globally, although I'd still imagine usage is more skewed towards Anglophone communities, given that macro names, error messages, documentation, the *TeXbook*, etc. are all in English.
6
https://tex.stackexchange.com/users/91603
692221
321,119
https://tex.stackexchange.com/questions/692209
0
How can I achieve proper horizontal alignment for the "n" in the MWE? Couldn't find anything in the docs... <https://ctan.mc1.root.project-creative.net/graphics/pgf/contrib/quantikz/quantikz.pdf> ``` \documentclass[tikz]{standalone} \usetikzlibrary{quantikz2} \usepackage{braket} \begin{document} \begin{quantikz} \lstick{$\ket{0}$}&\qwbundle{n}&\gate{U}&\gate{U_a} &\meter{} \end{quantikz} \end{document} ```
https://tex.stackexchange.com/users/299754
Quantikz horizontal alignment for qwbundle
true
Do you mean like this, with some exaggeration? If so, the key is on p. 18 of the manual "B. Per-Gate Styling". To demonstrate I put the n in red, and shifted it along the x-direction. This package requires some "encapsulation" of tikz-formatting-options: the kind of syntax you'd use when defining own styles etc. ``` \documentclass[10pt,border=3mm,tikz]{standalone} \usetikzlibrary{quantikz2} \usepackage{braket} \begin{document} \begin{quantikz} \lstick{$\ket{0}$}&\qwbundle{n}&\gate{U}&\gate{U_a} &\meter{}\\ \lstick{$\ket{0}$}&\qwbundle[style={red,xshift=4mm}]{n}&\gate{U}&\gate{U_a} &\meter{} \end{quantikz} \end{document} ```
1
https://tex.stackexchange.com/users/245790
692224
321,120
https://tex.stackexchange.com/questions/692214
1
I tried relative coordinates, but couldn't put a coordinate in to make angles. Is this possible? ``` \documentclass{standalone} \usepackage{tikz} \usetikzlibrary{calc} \usetikzlibrary{quotes,angles,calc,plotmarks,decorations.text} \begin{document} \begin{tikzpicture} \draw[red,fill=red] (3:0) circle (.5ex); %\draw[help lines] (-1,0) grid (5,5); %\draw (0,0) --++(2,0) --++(72:2)--++(144:1.75)--++(210:1.75) --cycle ; \draw (0,0) --(2,0) -- (2.5,2) -- (1,3) --(-0.5,2) --cycle ; \coordinate (a) at (0,0); \coordinate (b) at (2,0); \coordinate (c) at (2.5,2); \coordinate (d) at (1,3); \coordinate (e) at (-0.5,2); \node[align=center, below ] at (a) {1}; \node[align=center, below ] at (b) {2}; \node[align=center,right ] at (c) {3}; \node[align=center,above ] at (d) {4}; \node[align=center,left ] at (e) {5}; %\pic [draw, -, "$\alpha_0$", angle eccentricity=1.5] {angle = c--b--a}; \pic [draw, -, "$\alpha_1$", angle eccentricity=1.5] {angle = a--e--d}; \pic [draw, -, "$\alpha_2$", angle eccentricity=1.5] {angle = e--d--c}; \pic [draw, -, "$\alpha_3$", angle eccentricity=1.5] {angle = d--c--b}; \pic [draw, -, "$\alpha_3$", angle eccentricity=1.5] {angle = b--a--e}; \draw pic[draw,fill=green!30,angle radius=0.4cm,"$ $" shift={(0mm,-5mm)}] {angle= c--b--a}; \end{tikzpicture} \end{document} ```
https://tex.stackexchange.com/users/149116
I would like a perfect pentagon with 108° angles
true
There are plenty of ways to find the corners of a regular pentagon. Here I'm just using absolute polar coordinates, the first one and the last one gets aliases that make it easier to reference them later in a loop. The `mark with dashes = <num>` pic draws `<num>` slanted lines which we will place along the sides. Code ---- ``` \documentclass[tikz]{standalone} \usetikzlibrary{angles, quotes} \tikzset{ mark with dashes/.style={ every to/.append style={edge node={pic{mark with dashes={#1}}}}}, pics/mark with dashes/.style={ /tikz/sloped, /tikz/allow upside down, /tikz/line width=+.4pt,% thin code={ \foreach \i in {1, ..., #1} \draw[line cap=round, shift=(left:{\i pt-(#1+1)/2}), pic actions] (-1pt, -2pt) -- (1pt, 2pt);}}} \begin{document} \begin{tikzpicture}[angle eccentricity=1.5] \foreach[count=\j from 0, count=\i] \p in {below, below, right, above, left} \coordinate["$\i$" \p] (c\i) at (90+72*2+\j*72:2); \node also[alias=c0] (c5) node also[alias=c6] (c1); \foreach[count=\j from 2, count=\k from 0] \i in {1, ..., 5} \pic[draw, "$\alpha_\i$"] {angle=c\j--c\i--c\k}; \draw[mark with dashes=2, thick] (c1) to (c2) to (c3) to (c4) to (c5) to cycle; \end{tikzpicture} \end{document} ``` Output ------
6
https://tex.stackexchange.com/users/16595
692233
321,125
https://tex.stackexchange.com/questions/692222
1
I have the challenge of needing to start a *clean page* in a *two-column* (Xe)LaTeX document, yet *without the fush* semantics of `\clearpage`. Consider the following example, which is the closest I got to achieving the desired output: ``` \afterpage { \clearpage \begin{tikzpicture}[remember picture,overlay,x=\paperwidth,y=\paperheight]% ... \end{tikzpicture} \clearpage } ``` This waits until the current page has ended, and then fills in a `tikzpicture`, such that I can draw on an empty following page. After this drawing, the regular document resumes - just like pasting a picture page into the regular document. However, the following problems exist: * Due to the `\clearpage`, the above code forces all prior floats to be flushed. This is actually undesired since I have plenty of floats and I don't want the tikzpicture to interfere with the placement. I would like to **avoid the flushing**. * If I replace `\clearpage` with `\newpage`, I can avoid the flushing but this approach is unsuitable for a two-column document, since there `\newpage` changes its meaning to starting a new column. * If I replace `\clearpage` with `\newpage~\newpage` I must always make sure to only trigger it after even columns. * If I *remove* the first `\clearpage`, the `tikzpicture` actually does start on a new page as desired; however, the subsequent document content is placed below the `tikzpicture`. I assume that two different solution approaches may be possible but I did not manage to succeed with either one: * Find a two-column `\clearpage` without flush * Use `\afterpage{\tikz{...}\magic\newpage~\newpage}` where `\magic` assures that no other content appears on the page. Any suggestions or thoughts would be most appreciated.
https://tex.stackexchange.com/users/301493
Start a new page in two-column mode without \clearpage
false
The `\null` is because you can't have two `\newpage`s (or `\newcolumn`s) in a row. ``` \documentclass[twocolumn]{article} \usepackage{lipsum} \let\newcolumn=\newpage \makeatletter \renewcommand{\newpage}{\if@firstcolumn\newcolumn\null\fi \newcolumn} \makeatother \begin{document} \lipsum[1] \newpage \lipsum[2] \end{document} ```
1
https://tex.stackexchange.com/users/34505
692234
321,126
https://tex.stackexchange.com/questions/692235
1
I have a multilayered math environment in a two column article. The equations go past the column width. How do I avoid that? Below is my MWE. P.S. I've loaded the breqn package, but I don't know how to use it in this context. ``` \documentclass[journal]{IEEEtran} \usepackage{graphicx} % Required for inserting images \usepackage{amsfonts, amsmath, amsthm, amssymb} \usepackage{breqn} %================% % New Commands % %================% % Bold math variables \newcommand{\fb}{\mathbf{f}} \newcommand{\xb}{\mathbf{x}} \newcommand{\ub}{\mathbf{u}} \newcommand{\chib}{\boldsymbol{\chi}} \begin{document} \begin{gather*}\label{eq:unscented_problem_formulation} \xb_i := (x_i,y_i,h_i,v_i,\gamma_i,\sigma_i,\phi_i) \in \mathbb{R}^7 \qquad \ub := (u_\phi,u_L) \in \mathbb{R}^2 \qquad \\ \chib_i \in supp(\varepsilon_T,\phi_T) \qquad \forall\,i=1,\dots,N_\chi \\ \begin{array}{l l} \textsf{Min} & J[\xb(\cdot),t_f] := \displaystyle \sum_{i=1}^{N_\chi}w_i\left[(\gamma_i(t_f) - \overline{\gamma}_f)^2 + (\sigma_i(t_f) - \overline{\sigma}_f)^2\right] \\ \textsf{s.t.} & \dot{\xb}_1 = \fb(\xb_1,\ub,t) \\ & \vdots \\ & \dot{\xb}_{N_\chi} = \fb(\xb_{N_\chi},\ub,t) \\ &\xb_i(t_0) = (0\text{ m},0\text{ m},1\text{ m},1\text{ m/s},0\text{ rad},0\text{ rad},0\text{ rad}) \qquad \forall\,i=1,\dots,N_\chi. \\ & (t_0,t_f) = (0,1) \text{ s} \\ & \displaystyle \sum_{i=1}^{N_\chi}w_i\gamma_i(t_f) = \overline{\gamma}_f = 0 \\ & \displaystyle \sum_{i=1}^{N_\chi}w_i\sigma_i(t_f) = \overline{\sigma}_f = 0 \\ & u_\phi \in [-4\pi,4\pi] \text{ rad} \\ & u_L \in [-10000,10000] \text{ N} \\ & \varepsilon_T\, \sim\, \mathcal{N}(0.001,0.001^2) \text{ rad} \\ & \phi_T\, \sim\, \mathcal{U}[0,2\pi] \text{ rad} \end{array} \end{gather*} \end{document} ```
https://tex.stackexchange.com/users/279619
How to force a multilayered math environment to column width
false
I don't think a useful purpose is served by enclosing all math terms at hand in a single `gather*` environment. I suggest inserting a line break before `\forall\ i=1,\dots,N_{\chi}` to make the material fit inside the width of a column. Do yourself a favor and load the [siunitx](https://ctan.org/pkg/siunitx) package, to gain access to its `\unit` and `\qty` statements. And, since the document employs a Times Roman text font clone, you might was well load the `newtxtmath` package to get a math font that matches the text font. ``` \documentclass[journal]{IEEEtran} \usepackage{graphicx} \usepackage{mathtools, amsthm, amssymb} \usepackage{newtxtext, newtxmath} % Times Roman clone text and math fonts \DeclareMathOperator{\rad}{rad} \DeclareMathOperator{\supp}{supp} \usepackage[per-mode=symbol]{siunitx} % for \qty and \unit macros \usepackage{lipsum} % for filler text \newcommand{\fb}{\mathbf{f}} \newcommand{\xb}{\mathbf{x}} \newcommand{\ub}{\mathbf{u}} \newcommand{\chib}{\boldsymbol{\chi}} \begin{document} \begin{gather*}% \label{eq:unscented_problem_formulation} \begin{aligned} &\xb_i \coloneqq (x_i,y_i,h_i,v_i,\gamma_i,\sigma_i,\phi_i) \in \mathbb{R}^7 \\ &\ub \coloneqq (u_\phi,u_L) \in \mathbb{R}^2 \\ &\chib_i \in \supp(\varepsilon_T,\phi_T) \quad \forall\,i=1,\dots,N_{\chi} \end{aligned} \\[\jot] \textsf{Min}\, J[\xb(\cdot),t_f] \coloneqq \displaystyle \sum_{i=1}^{N_{\chi}}w_i \bigl[(\gamma_i(t_f) - \bar{\gamma}_f)^2 + (\sigma_i(t_f) - \bar{\sigma}_f)^2 \bigr] \end{gather*} such that \[ \begin{aligned} &\dot{\xb}_1 = \fb(\xb_1,\ub,t) \\ &\,\,\vdots \\ &\dot{\xb}_{N_{\chi}} = \fb(\xb_{N_{\chi}},\ub,t) \\ &\xb_i(t_0) = (\qty{0}{\meter},\qty{0}{\meter},\qty{1}{\meter}, \qty{1}{\meter\per\second}, \qty{0}{\rad}, \qty{0}{\rad}, \qty{0}{\rad}) \\ &\qquad\qquad \forall\ i=1,\dots,N_{\chi}. \\ &(t_0,t_f) = (\qty{0}{\second},\qty{1}{\second}) \\ &\sum\nolimits_{i=1}^{N_{\chi}} w_i\gamma_i(t_f) = \bar{\gamma}_f = 0 \\[\jot] &\sum\nolimits_{i=1}^{N_{\chi}} w_i\sigma_i(t_f) = \bar{\sigma}_f = 0 \\ &u_\phi \in [-4\pi,4\pi]\,\unit{\rad} \\ &u_L \in [-10000,10000]\, \unit{\newton} \\ &\varepsilon_T \sim \mathcal{N}(0.001,0.001^2)\,\unit{\rad} \\ &\phi_T \sim \mathcal{U}[0,2\pi]\,\unit{\rad} \end{aligned} \] \lipsum % filler text \end{document} ```
1
https://tex.stackexchange.com/users/5001
692241
321,129
https://tex.stackexchange.com/questions/692235
1
I have a multilayered math environment in a two column article. The equations go past the column width. How do I avoid that? Below is my MWE. P.S. I've loaded the breqn package, but I don't know how to use it in this context. ``` \documentclass[journal]{IEEEtran} \usepackage{graphicx} % Required for inserting images \usepackage{amsfonts, amsmath, amsthm, amssymb} \usepackage{breqn} %================% % New Commands % %================% % Bold math variables \newcommand{\fb}{\mathbf{f}} \newcommand{\xb}{\mathbf{x}} \newcommand{\ub}{\mathbf{u}} \newcommand{\chib}{\boldsymbol{\chi}} \begin{document} \begin{gather*}\label{eq:unscented_problem_formulation} \xb_i := (x_i,y_i,h_i,v_i,\gamma_i,\sigma_i,\phi_i) \in \mathbb{R}^7 \qquad \ub := (u_\phi,u_L) \in \mathbb{R}^2 \qquad \\ \chib_i \in supp(\varepsilon_T,\phi_T) \qquad \forall\,i=1,\dots,N_\chi \\ \begin{array}{l l} \textsf{Min} & J[\xb(\cdot),t_f] := \displaystyle \sum_{i=1}^{N_\chi}w_i\left[(\gamma_i(t_f) - \overline{\gamma}_f)^2 + (\sigma_i(t_f) - \overline{\sigma}_f)^2\right] \\ \textsf{s.t.} & \dot{\xb}_1 = \fb(\xb_1,\ub,t) \\ & \vdots \\ & \dot{\xb}_{N_\chi} = \fb(\xb_{N_\chi},\ub,t) \\ &\xb_i(t_0) = (0\text{ m},0\text{ m},1\text{ m},1\text{ m/s},0\text{ rad},0\text{ rad},0\text{ rad}) \qquad \forall\,i=1,\dots,N_\chi. \\ & (t_0,t_f) = (0,1) \text{ s} \\ & \displaystyle \sum_{i=1}^{N_\chi}w_i\gamma_i(t_f) = \overline{\gamma}_f = 0 \\ & \displaystyle \sum_{i=1}^{N_\chi}w_i\sigma_i(t_f) = \overline{\sigma}_f = 0 \\ & u_\phi \in [-4\pi,4\pi] \text{ rad} \\ & u_L \in [-10000,10000] \text{ N} \\ & \varepsilon_T\, \sim\, \mathcal{N}(0.001,0.001^2) \text{ rad} \\ & \phi_T\, \sim\, \mathcal{U}[0,2\pi] \text{ rad} \end{array} \end{gather*} \end{document} ```
https://tex.stackexchange.com/users/279619
How to force a multilayered math environment to column width
false
Here is one way to format this long expression. I'd like to point out LaTeX has plenty of math environments including their inner variants, which you can nest, which let you format and organise very complex expressions. It's all explained in the documentation of the package [amsmath](https://www.ctan.org/pkg/amsmath). I would also recommend reading documentation of [mathtools](https://www.ctan.org/pkg/mathtools), which loads [amsmath](https://www.ctan.org/pkg/amsmath) and adds many improvements and additional solutions. The code ``` \documentclass[journal]{IEEEtran} \usepackage{graphicx} % Required for inserting images \usepackage{amsthm, amssymb} \usepackage{breqn} \usepackage{kantlipsum} % ================% % New Commands % % ================% % Bold math variables \newcommand{\fb}{\mathbf{f}} \newcommand{\xb}{\mathbf{x}} \newcommand{\ub}{\mathbf{u}} \newcommand{\chib}{\boldsymbol{\chi}} \begin{document} \kant[1][1] \begin{gather*} \begin{aligned} & \xb_i := (x_i,y_i,h_i,v_i,\gamma_i,\sigma_i,\phi_i) \in \mathbb{R}^7 \\ & \ub := (u_\phi,u_L) \in \mathbb{R}^2 \end{aligned} \\ \chib_i \in \operatorname{supp}(\varepsilon_T,\phi_T, \ i=1,\dots,N_\chi \\ \begin{aligned} & \operatorname{Min} J[\xb(\cdot),t_f :={} \sum_{i=1}^{N_\chi}w_i \bigl[ (\gamma_i(t_f) - \overline{\gamma}_f)^2 + (\sigma_i(t_f) - \overline{\sigma}_f)^2 \bigr] \\ & \footnotesize \qquad\textsf{s.t.}\ \begin{aligned}[t] & \dot{\xb}_1 = \fb(\xb_1,\ub,t) \\ & \vdots \\ & \dot{\xb}_{N_\chi} = \fb(\xb_{N_\chi},\ub,t) \\ & xb_i(t_0) = (0\text{ m},0\text{ m},1\text{ m},1\text{ m/s},0\text{ rad},0\text{ rad},0\text{ rad}) \\ & \qquad\forall\,i=1,\dots,N_\chi. \\ & (t_0,t_f) = (0,1) \text{ s} \\ & \displaystyle \sum_{i=1}^{N_\chi}w_i\gamma_i(t_f) = \overline{\gamma}_f = 0 \\ & \displaystyle \sum_{i=1}^{N_\chi}w_i\sigma_i(t_f) = \overline{\sigma}_f = 0 \\ & u_\phi \in [-4\pi,4\pi] \text{ rad} \\ & u_L \in [-10000,10000] \text{ N} \\ & \varepsilon_T\, \sim\, \mathcal{N}(0.001,0.001^2) \text{ rad} \\ & \phi_T\, \sim\, \mathcal{U}[0,2\pi] \text{ rad} \end{aligned} \end{aligned} \end{gather*} \kant[2-5] \end{document} ``` and screenshot
0
https://tex.stackexchange.com/users/31283
692244
321,130
https://tex.stackexchange.com/questions/617572
0
I am using this command to compile latex document in terminal like this: ``` latexmk -pdfxe -pvc -xelatex -interaction=nonstopmode -output-directory="./build" ``` everything goes fine. But I still facing problem that sometimes the compile may be failed and the problem is that I can hardly found out where is going wrong from the terminal ouput. I was wonder is it possible to make the latexmk ouput more better like the error message with a red color and the warning message with the yellow color or other way to make it more easy to figure out where is going wrong. is there any improment way to make it possible?
https://tex.stackexchange.com/users/69600
is it possible to make latexmk ouput with color
false
Yes, it is possible but you will have to modify your `latexmkrc` or use an independent program to pipe the output through. The example is explained [in this blog post](https://blog.mje.nz/2019-07-23-coloured-latexmk-output/), you have two options: 1. modifying latexmkrc 2. Using bespoke solution in Python or similar to cooler outputs latexmkrc ========= ``` { no warnings 'redefine'; use Term::ANSIColor; my $old_warn_running = \&main::warn_running; sub color_warn_running { print STDERR color('green'); $old_warn_running->(@_); print STDERR color('reset'); } if (-t STDERR) { # Only use color if a terminal is attached *main::warn_running = \&color_warn_running; } } ``` Python-based solution ===================== ``` #!/usr/bin/env python3 """Filter output of pdflatex. Usage: filter.py <latex engine> <options> <file> """ import os import subprocess import sys import colorama from colorama import Fore, Style colorama.init() def main(cmd): # Disable pdflatex line wrap (where possible) env = dict(os.environ, max_print_line="1000000000") # Run pdflatex and filter/colour output pdflatex = subprocess.Popen( cmd, env=env, stdout=subprocess.PIPE, stderr=subprocess.STDOUT ) for line in iter(pdflatex.stdout.readline, b''): line = line.decode('utf8').strip() if line.startswith('(/') or line.startswith('(./'): # Start loading file pass elif line.startswith(')'): # Finish loading file pass elif line.startswith('!'): # Error print(Fore.RED + line + Style.RESET_ALL) elif line.startswith('Overfull') or \ line.startswith('Underfull') or \ 'warning' in line.lower() or \ 'missing' in line.lower() or \ 'undefined' in line.lower(): # Warning print(Fore.YELLOW + line + Style.RESET_ALL) else: print(line) if __name__ == '__main__': assert len(sys.argv) > 1 main(sys.argv[1:]) ``` You would then add `$pdflatex = "./filter.py pdflatex %O %S";` to your `latexmkrc`.
0
https://tex.stackexchange.com/users/123504
692251
321,133
https://tex.stackexchange.com/questions/692209
0
How can I achieve proper horizontal alignment for the "n" in the MWE? Couldn't find anything in the docs... <https://ctan.mc1.root.project-creative.net/graphics/pgf/contrib/quantikz/quantikz.pdf> ``` \documentclass[tikz]{standalone} \usetikzlibrary{quantikz2} \usepackage{braket} \begin{document} \begin{quantikz} \lstick{$\ket{0}$}&\qwbundle{n}&\gate{U}&\gate{U_a} &\meter{} \end{quantikz} \end{document} ```
https://tex.stackexchange.com/users/299754
Quantikz horizontal alignment for qwbundle
false
To answer the follow-up question from a comment. The best will be to contact the author of the `quantikz` package. To my understanding, the empty space is related to the nodes and grid placement involved. It's not related to the braket characters. To demonstrate kindly check: * the outline of the nodes shape * changes when setting the `inner sep=0` * limitations imposed by `\lstick` on `label style` formatting, only ``` \documentclass[10pt,border=3mm,tikz]{standalone} \usetikzlibrary{quantikz2} \usepackage{braket} \begin{document} \begin{quantikz} \lstick{$\ket{0}$}&\qwbundle{n}&\gate{U}&\gate{U_a} &\meter{}\\ \lstick{$\ket{0}$}&\qwbundle[style={red,xshift=4mm}]{n}&\gate{U}&\gate{U_a} &\meter{}\\ \lstick[label style={draw=blue}]{$\alpha$}&\qwbundle[style={red,xshift=2mm}]{n}&\gate{U}&\gate{U_a} &\meter{}\\ \lstick[label style={inner sep=0mm,draw=blue}]{$\alpha$}&\qwbundle[style={red,xshift=2mm}]{n}&\gate{U}&\gate{U_a} &\meter{} \end{quantikz} \end{document} ```
0
https://tex.stackexchange.com/users/245790
692252
321,134
https://tex.stackexchange.com/questions/692255
1
The compile is good but I get this error :Unicode character : (U+FF1A) ``` \documentclass{report} \usepackage[utf8]{inputenc} \usepackage{graphicx} % Required for inserting images \usepackage{setspace}% for\doublespacing \usepackage{indentfirst}% for indent the first line \usepackage{longtable} \usepackage{textalpha} \usepackage{ragged2e} \usepackage[T1]{fontenc} % <-- new \usepackage{xltabular} \begin{document} The Social interaction (SI) test setup comprised a 42 \texttimes 42 cm Plexiglas arena with a 6.5 \texttimes 10 cm wire mesh cage on one side that allowed for olfactory and minimal tactile interaction. The social interaction zone (SIZ) encompasses a 14 \texttimes 24 cm area projecting 8 cm around the wire-mesh enclosure (Figure A). The protocol included two trials, one without and one with an unfamiliar CD1 mouse present in the wire mesh enclosure, in this order, both covering 2.5 minutes. The C57BL/6J mouse was placed in the center of this arena, facing the SIZ, and could freely explore the chamber. After 2.5 min, the mouse was removed, and an unfamiliar CD1 mouse was placed in the cage. During this second trial, the C57BL/6J mouse’s reaction to the CD1 mouse was registered. Locomotion and time spent in the SIZ were recorded. The immobility time within the SIZ (indicating potential freezing behavior) was registered to adjust the C57BL/6J mouse’s time interacted with the CD1 mouse. The social interaction ratio (SIR) was calculated as a parameter to indicate social behavior. Variables analyzed within the SI test were locomotion (without a social target) and the social interaction ratio:\par \end{document} ```
https://tex.stackexchange.com/users/301169
There is an error in Latex: LaTeX Error: Unicode character : (U+FF1A)
true
U+FF1A is `:` full width colon designed for Asian scripts, replace it by `:` a standard colon. ie replace `social interaction ratio:` by `social interaction ratio:`
1
https://tex.stackexchange.com/users/1090
692256
321,136
https://tex.stackexchange.com/questions/692260
1
Let's say that I have two columns of data: one with the values of some measures and the other with its uncertainty. What's the simplest way to join this in a table? I see it's quite difficult to manually write `value $\pm$ uncertainty` in each cell on a `\begin{tabular}` enviroment, so I was wondering if there was another way of doing this.
https://tex.stackexchange.com/users/301440
What's the most efficient way to write uncertainties of data in a table?
false
Another way. See also siunitx to align decimals. ``` \documentclass{article} \begin{document} \begin{tabular}{r@{$\null\pm\null$}l} 3.14 & 0.5 \end{tabular} \end{document} ```
1
https://tex.stackexchange.com/users/34505
692261
321,137
https://tex.stackexchange.com/questions/692259
-1
How do I set a fixed background on all pages (for example, in the center of each page) I want to place this background with the following code in the center of all pages ``` \begin{tikzpicture}[overlay] \node[blue!45, rotate = 30] at (3,-1.4) { \begin{tikzpicture} \draw[line width=0.2 mm] circle[radius=2 cm]; \draw[line width=0.2 mm] circle[radius=1.95 cm]; inner circles \draw[line width=0.2 mm] circle[radius=1.3 cm] ; \draw[line width=0.2 mm] circle[radius=1.25 cm] ; \path[ postaction={ decoration={ text along path,,text color=blue!45, text={ PROF~~ MEBKHOUTA }, text align=center, reverse path }, decorate } ] (10:1.5cm) arc (10:180:1.5cm); \node[blue!30,rotate=-60] at (350:1.6cm) {$\bigstar$}; \node[blue!30,rotate=60] at (190:1.6cm) {$\bigstar$}; \path [postaction={decorate,decoration={text along path,text color=blue!50, text align=fit to path,text={OUSSAMA}}}] (209:1.8cm) arc (209:330:1.8cm); central text \node[font=\fontsize{12}{12}\selectfont] at (0, 0){{ الرياضيات}}; \end{tikzpicture} }; \end{tikzpicture}` ```
https://tex.stackexchange.com/users/300410
How do I set a fixed background on all pages (for example, in the center of each page)
false
I gave up trying to fix your tkizpicture. I did check that [overlay] by itself will place the "cursor" on the origin. However, the following will work even when the center is not at the origin. There is a lot of overhead each time you create a tikzpicture, so I made one copy and put it into a savebox. ``` \documentclass{article} \usepackage{tikz} \usepackage{lipsum}% fkae text \newsavebox{\background} \savebox{\background}{\begin{tikzpicture} \node[draw, red] at (1,1) {Background}; \coordinate (center) at (current bounding box.center); \pgfresetboundingbox \path(center); \end{tikzpicture}} \AddToHook{shipout/background}{\put (0.5\paperwidth, -0.5\paperheight) {\usebox\background}} \begin{document} \lipsum[1-12] \end{document} ```
2
https://tex.stackexchange.com/users/34505
692262
321,138
https://tex.stackexchange.com/questions/692277
13
I have a personal dislike of the CM typewriter italic design. (Sorry, DEK :). It's fine for what it is, but I just find it distractingly fancy.) For TUGboat, I always want to replace it with typewriter slanted. My question is, is there a way to do such a fundamental substitution at the LaTeX level? (I don't want to distribute different .fd files for TUGboat. That would be much too error-prone for authors, aside from being generally crazy. :) Trivial example: ``` \documentclass{article} \begin{document} \textit{\texttt{Italic typewriter that I want to be slanted.}} \end{document} ``` For this tiny case, it's obviously no problem to replace \textit with \textsl in the TeX source. But in practice there are plenty of times when it is not so simple, because the \textit, or \emph, or whatever, is buried inside macros, the result of running BibTeX or other subprograms, etc. Many packages (e.g., listings) have their own configuration methods that can suffice. I just wondered if there was a way to do it globally. It would save me a lot of time and effort. --thanks, karl.
https://tex.stackexchange.com/users/63279
replacing tt italic with tt slanted at LaTeX level?
false
Make sure you load the font description file and then change the relevant definition. ``` \documentclass{article} %\usepackage[T1]{fontenc} % Load <enc>cmtt.fd \LoadFontDefinitionFile{\encodingdefault}{cmtt} % replace it with sl \ExpandArgs{c}\def{\encodingdefault/cmtt/m/it}{<->ssub*cmtt/m/sl} \begin{document} \texttt{\textit{test italic=slanted}} \texttt{test upright} \end{document} ```
11
https://tex.stackexchange.com/users/4427
692280
321,144
https://tex.stackexchange.com/questions/692277
13
I have a personal dislike of the CM typewriter italic design. (Sorry, DEK :). It's fine for what it is, but I just find it distractingly fancy.) For TUGboat, I always want to replace it with typewriter slanted. My question is, is there a way to do such a fundamental substitution at the LaTeX level? (I don't want to distribute different .fd files for TUGboat. That would be much too error-prone for authors, aside from being generally crazy. :) Trivial example: ``` \documentclass{article} \begin{document} \textit{\texttt{Italic typewriter that I want to be slanted.}} \end{document} ``` For this tiny case, it's obviously no problem to replace \textit with \textsl in the TeX source. But in practice there are plenty of times when it is not so simple, because the \textit, or \emph, or whatever, is buried inside macros, the result of running BibTeX or other subprograms, etc. Many packages (e.g., listings) have their own configuration methods that can suffice. I just wondered if there was a way to do it globally. It would save me a lot of time and effort. --thanks, karl.
https://tex.stackexchange.com/users/63279
replacing tt italic with tt slanted at LaTeX level?
true
ohh egreg a bit quicker but mine's more readable:-) ``` \documentclass{article} \makeatletter %\usepackage[T1]{fontenc}% or OT1 or TU... %FMi {\ttfamily}% force fd to load \LoadFontDefinitionFile{\f@encoding}{cmtt}% force fd to load \DeclareFontShape{\f@encoding}{cmtt}{m}{it} {<->ssub*cmtt/m/sl}{} \makeatother \begin{document} \textit{\texttt{Italic typewriter that I want to be slanted.}} \end{document} ```
11
https://tex.stackexchange.com/users/1090
692281
321,145
https://tex.stackexchange.com/questions/504558
7
I have a macro to draw rather complicated diagrams in tikz which makes use of pgfkeys in order to be as flexible as possible on arrows, labels and their styles. I allow all the commands of the library *cd*. What I would need is a parameter/option, such as `Rrightarrow` of the *ams* package, that I can pass as pgfkey which could draw triple (or even quadruple) arrows, precisely like I can pass the parameters `leftarrow`, `Rightarrow`, `equal`, `squiggly`, ... The following topics [Triple lines in tikz](https://tex.stackexchange.com/questions/38431/triple-lines-in-tikz) and [Costum arrow shaft in tikz](https://tex.stackexchange.com/questions/230098/custom-arrow-shaft-in-tikz) contain some beautiful code going in that direction, but I am not able to squeeze them into a tikz-cd arrow-style option. I think I understand the code of the (second answer of the) second link, where in order to provide a 3-arrow or a 4-arrow, two different arrows are overlapped. Since the arrows of my macro are fixed, I cannot use this solution. I think the code of the first link could be used to provide a satisfying solution but: I don't know a lot of tikz yet (I have always used tikzcd), in the comments there they seem to imply that adding a arrow tip to a triple line is hard. I tried to play a bit with the code, modifying what I think should be chanced, but I haven't managed to produce anything concrete.
https://tex.stackexchange.com/users/25158
Triple arrows in tikz and tikz-cd
false
There is now a beautiful package, [tikz-nfold](https://ctan.org/pkg/tikz-nfold) by Jonathan Schulz, providing a simple solution to this problem. You can specify the TikZ arrow style `scaling nfold=3` (or simply `nfold=3` if you want a fixed arrow width) to draw a triple arrow, and similarly for higher arrows. In my experience, this produces more aesthetically pleasing arrows than other solutions, and is compatible with the various other TikZ styles that are common in commutative diagrams. Example: ``` \documentclass{article} \usepackage{tikz-cd} \usetikzlibrary{nfold} \begin{document} \begin{tikzcd} A \arrow[r, Rightarrow, scaling nfold=3] & B \\ C \arrow[r, Rightarrow, nfold=3] & D \end{tikzcd} \end{document} ``` Produces:
2
https://tex.stackexchange.com/users/214142
692283
321,146
https://tex.stackexchange.com/questions/230098
5
I'm trying to go from xypic to tikz but there are a number of xypic features that I don't seem to be able to find in tikz. In tikz you can easily draw double-arrows, which is about the same as using `\ar@2` in xypic. I also use triple and quadruple arrows in xypic, with `ar@3` and `ar@4` (the last one is a custom shaft). My question is: How is it possible to draw triple/quadruple arrows in Tikz? I am willing to try and define custom arrow shafts if need be, but I can't find how to do that in the tikz manual (which is quite formidable by the way).
https://tex.stackexchange.com/users/72741
Custom arrow shaft in tikz
false
There is now a simple solution to this problem, using the [tikz-nfold](https://ctan.org/pkg/tikz-nfold) library. Example: ``` \documentclass{article} \usepackage{tikz-cd} \usetikzlibrary{nfold} \begin{document} \begin{tikzcd} A \arrow[dr, Rightarrow, scaling nfold=4, bend right] & \\ & B \end{tikzcd} \end{document} ``` Produces:
3
https://tex.stackexchange.com/users/214142
692284
321,147
https://tex.stackexchange.com/questions/692246
0
In my declaration form, I like to write a latex minipage to include the Signature, Name, Registration Number , Place and Date at the bottom of the page. However, they are appearing in a scattered way. ``` \documentclass{article} \begin{document} \begin{center} \large \textbf{Declaration} \end{center} 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. \vspace{2cm} \begin{tabular}{p{7cm}p{5cm}} \dotfill & \dotfill \\ Signature & Date \\ & \\ \dotfill & \dotfill \\ Name & Place \\ & \\ \dotfill & \dotfill \\ Registration Number & \end{tabular} \end{document} ``` It is not mandatory to use minipage, any other approach ( like sub-figure or tabular or anything) that can give the desired output is welcome. Also the dotted lines may be removed and hard coded ( except the signature portion), if they look odd.
https://tex.stackexchange.com/users/218773
Can not place Name, date signature in the declaration
false
You want that the `tabular` has the same width as the text block. ``` \documentclass{article} \begin{document} \begin{center} \large \textbf{Declaration} \end{center} \noindent 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. \vspace{2cm} \noindent \begin{tabular}{ @{}p{\dimexpr0.55\textwidth} @{\hspace{0.05\textwidth}} p{\dimexpr0.40\textwidth}@{} } \dotfill & \dotfill \\ Signature & Date \\ & \\ \dotfill & \dotfill \\ Name & Place \\ & \\ \dotfill & \dotfill \\ Registration Number & \end{tabular} \end{document} ``` Note the `\noindent` to avoid the standard paragraph indentation.
1
https://tex.stackexchange.com/users/4427
692301
321,154
https://tex.stackexchange.com/questions/692302
0
``` \begin{center} \begin{mdframed}[userdefinedwidth= 0.8\textwidth, innerbottommargin= 10] \begin{table}[H] \centering \def\arraystretch{1.5}% \begin{tabular}{|c|c|} \hline \rowcolor{gray!20} \textbf{Row operations on I} & \textbf{Row operations on E} \\ \rowcolor{gray!20} \textbf{producing E} & \textbf{producing I} \\ \hline Exchange row $i$ with $j$ & Exchange row $j$ with $i$ \\ \hline Add $c$ times row $i$ to row $j$ & Add ${-c}$ times row $i$ to row $j$ \\ \hline Multiply row $i$ by $c \neq 0$ & Multiply row $i$ by $\frac{1}{c}$ \\ \hline \end{tabular} \end{table} \end{mdframed} \end{center} ```
https://tex.stackexchange.com/users/301174
Table placement issue: cannot get the table within mdframed to center horizontally on page
false
* Please always provide MWE (Minimal Working Example), a small but complete document, which beginning with `\documentclass` and `end{document}`. * Since preamble of your document is unknown, we can only guess, are you load to your problem relevant packages or use adequate `mdframed` option when loaded it. * newer insert float environment into some box! * your table is wider than width of `framed` box * make table narrower by use of `tabularx`˛ package and prescribe table width by `\linewidth` * for centering of `framed` use its option `align=center` ``` \documentclass{article} \usepackage[table]{xcolor} \usepackage{tabularx} \newcolumntype{C}{>{\centering\arraybackslash}X} \usepackage[framemethod=TikZ]{mdframed} \usepackage{lipsum} \begin{document} \lipsum[66][1-4] \begin{mdframed}[userdefinedwidth=0.9\textwidth, innerbottommargin= 10, align=center] \centering \def\arraystretch{1.5}% \begin{tabularx}{\linewidth}{|C|C|} \hline \rowcolor{gray!20} \textbf{Row operations on I producing E} & \textbf{Row operations on E producing I} \\ \hline Exchange row $i$ with $j$ & Exchange row $j$ with $i$ \\ \hline Add $c$ times row $i$ to row $j$ & Add ${-c}$ times row $i$ to row $j$ \\ \hline Multiply row $i$ by $c \neq 0$ & Multiply row $i$ by $\frac{1}{c}$ \\ \hline \end{tabularx} \end{mdframed} \lipsum[66] \end{document} ``` **Addendum:** * For centering of `mdframe` it should be loaded `tikz` package, explicitly or by `mdframe` option `[framemethod=TikZ]`. * Off-topic suggestions, just to show more possibilities to use `mdframe` and writing table in it by using `tabularay` package: ``` \documentclass{article} \usepackage{lipsum} % for dummy text filler \usepackage{xcolor} \usepackage{tabularray} \UseTblrLibrary{amsmat} % load amsmath package too \usepackage{mdframed} \usepackage{tikz} % for aligning of mdframe in text \begin{document} \lipsum[66][1-4] % some dummy text \begin{mdframed}[userdefinedwidth=0.8\linewidth, skipabove=\topskip, skipbelow=\topskip, % distance from text innerleftmargin=4pt, innerrightmargin=4pt, linewidth=1pt, linecolor=blue, align=center, % tikz package need to be loaded ] \begin{tblr}{hlines, vlines, % tabularray package need to be loaded colsep=4pt, colspec = {*{2}{X[c]}}, row{1} = {font=\bfseries, bg=gray!30}, rowsep=5pt} Row operations on I producing E & Row operations on E producing I \\ Exchange row $i$ with $j$ & Exchange row $j$ with $i$ \\ Add $c$ times row $i$ to row $j$& Add ${-c}$ times row $i$ to row $j$ \\ Multiply row $i$ by $c \neq 0$ & Multiply row $i$ by $\frac{1}{c}$ \\ \end{tblr} \end{mdframed} or maybe \begin{mdframed}[userdefinedwidth=0.8\linewidth, skipabove=\topskip, skipbelow=\topskip, % distance from text innerleftmargin=4pt, innerrightmargin=4pt, linewidth=1pt, linecolor=blue, align=center, % tikz package need to be loaded ] \begin{tblr}{hlines, vlines, % tabularray package need to be loaded colsep=4pt, colspec = {*{2}{X[l]}}, row{1} = {c, font=\bfseries, bg=gray!30}, rowsep=5pt} Row operations on I producing E & Row operations on E producing I \\ Exchange row $i$ with $j$ & Exchange row $j$ with $i$ \\ Add $c$ times row $i$ to row $j$& Add ${-c}$ times row $i$ to row $j$ \\ Multiply row $i$ by $c \neq 0$ & Multiply row $i$ by $\frac{1}{c}$ \\ \end{tblr} \end{mdframed} \lipsum[66] \end{document} ```
0
https://tex.stackexchange.com/users/18189
692303
321,155
https://tex.stackexchange.com/questions/692272
1
**Objective:** I need to get the page number of the left even pages (LE) on the left top corner: this fails when the header contains multiple lines (it is then printed on the second line). When I add `\parbox[t]` after `\thepage`, the pagenumber is on the top left (and first line). However, I receive new errors AND when the header is only one line, it moves the text one line down. The output can be viewed here: <https://ibb.co/ZX280PM> The error: > > Argument of @iiiparbox has an extra }. > > > I'm using an online script (freely available) *(note this is where I added \parbox[t])*. This is a part of it: ``` \fancypagestyle{mainmatter}{% \fancyhf{} %% Page numbers on the top left and top right. \fancyhead[LE]{\cropmarks\lthumb\titlefont\thepage{\parbox[t]}} \fancyhead[RO]{\cropmarks\rthumb\titlefont\thepage} %% Chapter name on the left (even) page. \fancyhead[RE]{\titlefont\titleshape\nouppercase{\leftmark}} %% Section name on the right (odd) page. \fancyhead[LO]{\titlefont\titleshape\nouppercase{\rightmark}} } ``` My dissertation.cls: ``` \NeedsTeXFormat{LaTeX2e} \ProvidesClass{dissertation}[2013/07/08 v1.0 TU Delft dissertation class] \newif\if@nativefonts \DeclareOption{nativefonts}{\@nativefontstrue} \newif\if@print \DeclareOption{print}{\@printtrue} \DeclareOption*{\PassOptionsToClass{\CurrentOption}{book}} \ProcessOptions\relax \LoadClass[10pt]{book} \RequirePackage{amsmath} \RequirePackage{amssymb} %% English is the default language, but Dutch is used for some sections. \RequirePackage[dutch,english]{babel} \RequirePackage{calc} \RequirePackage[nooneline,footnotesize]{caption} \RequirePackage{chapterbib} \RequirePackage{etaremune} \RequirePackage{fancyhdr} \RequirePackage[flushmargin,hang]{footmisc} \RequirePackage{ifpdf} \RequirePackage{ifxetex} \ifxetex \RequirePackage[xetex]{geometry} \RequirePackage[xetex]{graphicx} \RequirePackage[xetex]{hyperref} \RequirePackage{fontspec} \RequirePackage{xltxtra} \defaultfontfeatures{Ligatures=TeX} \else \ifpdf \RequirePackage[pdftex]{geometry} \RequirePackage[pdftex]{graphicx} \RequirePackage[pdftex]{hyperref} \else \RequirePackage[dvips]{geometry} \RequirePackage[dvips]{graphicx} \RequirePackage[hypertex]{hyperref} \fi \RequirePackage[T1]{fontenc} \RequirePackage[utf8]{inputenc} \fi \RequirePackage{lettrine} \RequirePackage{metalogo} \RequirePackage[sectionbib,numbers,sort&compress]{natbib} \RequirePackage{tikz} \RequirePackage[noindentafter]{titlesec} \RequirePackage{titletoc} \RequirePackage[nottoc]{tocbibind} \RequirePackage{xcolor} \RequirePackage{wrapfig} \RequirePackage{booktabs} \RequirePackage[flushleft]{threeparttable} \RequirePackage{adjustbox} \RequirePackage{bibentry} \usepackage{float} \RequirePackage{tabularx} \usepackage{rotating} \RequirePackage{lipsum} %% If the document is not compiled with XeLaTeX, we need to use the native %% fonts. \ifxetex\else \@nativefontstrue \fi \if@nativefonts %% The native font is Utopia Regular with Fourier math. We use Latin Modern %% as a fallback, since Utopia lacks support for sans-serif and monospace. \RequirePackage[T1]{fontenc} \RequirePackage[utf8]{inputenc} \RequirePackage{lmodern} \RequirePackage{fourier} %% The style for titles is small caps. \def\titlefont{\rmfamily} \def\titleshape{\scshape} \def\titlestyle{\titlefont\titleshape\bfseries} \if@print \def\headerstyle{\titlefont\titleshape\bfseries} \else \def\headerstyle{\titlefont\titleshape} \fi \definecolor{wesandersonred}{cmyk}{0.00,0.90,0.86,0.29} %% Set the paper size to 17 by 24 cm, approximately halfway between A4 and A5. \if@print %% In print mode we add a 3 mm bleed on the outside of the page. \geometry{ papersize = {173mm,246mm}, layoutsize = {167mm,240mm}, layoutoffset = {3mm,3mm}, bindingoffset = -3mm } \else \geometry{papersize={170mm,240mm}} \fi %% We decrease the margins slightly from the default (scale = 0.7). \geometry{hscale=0.75,vscale=0.8} %% Redefine the title command to accept an optional subtitle. \renewcommand*\title[2][]{% \def\@subtitle{#1}% \def\@title{#2}% %% Add the title to the PDF meta data. \hypersetup{pdftitle=#2}% } %% Fancy style for the main matter. \fancypagestyle{mainmatter}{% \fancyhf{} %% Page numbers on the top left and top right. \fancyhead[LE]{\titlefont\thepage} \fancyhead[RO]{\titlefont\thepage} %% Chapter name on the left (even) page. \fancyhead[RE]{\titlefont\titleshape\nouppercase{\leftmark}} %% Section name on the right (odd) page. \fancyhead[LO]{\titlefont\titleshape\nouppercase{\rightmark}} } %% The mainmatter style is default for normal pages. \pagestyle{mainmatter} %% Print the current chapter and section at the top of the page in cyan. \renewcommand*\chaptermark[1]{\markboth{\color{title}#1}{}} \renewcommand*\sectionmark[1]{\markright{\thesection.\ \color{title}#1}} %% Change the headrule command (from fancyhdr.sty) to draw the line below the %% header in the title color. \renewcommand*\headrule{% \if@fancyplain% \let\headrulewidth\plainheadrulewidth% \fi% {\color{title}\hrule\@height\headrulewidth\@width\headwidth}% \vskip-\headrulewidth% } ``` My dissertation.tex: ``` \documentclass{dissertation} \begin{document} \title[Test]{test} \author{Author}{Name} \mainmatter \include{chapter-4} \include{chapter-5} \end{document} ``` chapter-4.tex: ``` \chapter[This header needs to be long to be a two line header header \\ header header header]{This header needs to be long to be a two line header} \label{chapter_4} \newpage \lipsum[1] ``` chapter-5.tex: ``` \chapter[This header needs to be short to be a single line header ]{This header needs to be short} \label{chapter_5} \newpage \lipsum[2] ``` Could anyone help me with this task? EDIT: added .cls and .tex examples
https://tex.stackexchange.com/users/301526
Getting page number on top of two-lined header
true
In `dissertation.cls`, replace the page style you showed with the following: ``` \fancypagestyle{mainmatter}{% \fancyhf{} \fancyhead[LE]{% \titlefont{\parbox[b]{\headwidth}{% \raggedleft\thepage\hfill\titleshape\nouppercase{\leftmark}}% }% } \fancyhead[RO]{\titlefont\thepage} \fancyhead[RE]{} \fancyhead[LO]{\titlefont\titleshape\nouppercase{\rightmark}} } ``` This will ensure your page number is always at the top leftmost corner, sharing the same baseline as your running chapter header (dashed blue line for comparison): **How it works:** In this new code, instead of having a header left side and header right side for even pages, I simply empty the header right side. On the left side, I construct a box exactly the same width of the header, and I flush everything to the right (`\raggedleft`). On the first line, I insert the page number (`\thepage`), a horizontal space (`\hfill`), and the running chapter head (`\leftmark`). This creates the appearance of a distinct "left side" and "right side," and ensures the page number and first line of the running head are always on the same line.
0
https://tex.stackexchange.com/users/91603
692313
321,159
https://tex.stackexchange.com/questions/692317
1
``` \section{Question 1} \begin{figure} \centering \includegraphics[width=\linewidth]{Cute Goat In Pink.jpg} \caption{Daredevil} \label{fig:my_label} \end{figure} ``` Above is the code I am trying to use but for some reason, it is not showing up on the compiled pdf. So, I am using the online version of overleaf so I don't think the issue is with my version. Also, below is the entire code I am currently using: ``` \documentclass{article} \usepackage{graphicx} % Required for inserting images \title{CPSC} \author{} \date{July 2023} \begin{document} \maketitle \section{Question 1} Hello \begin{figure} \centering \includegraphics[width=\linewidth]{Cute Goat In Pink.jpg} \caption{Daredevil} \label{fig:my_label} \end{figure} Goodbye \end{document} ``` Unfortunately, the only thing showing up is hello and goodbye. As for the picture name, that is how it is saved. I tried replacing it with another one that is in all small letters with no spaces and still had the same issues. The log files in the pdf are showing absolutely no errors which is making me even more confused. And I copied this code directly from Overleaf so theoretically, it should work.
https://tex.stackexchange.com/users/301549
Image is showing up on visual editor but not on compiled pdf
true
`figure` is a floating environment. This means, if the image + caption does not fit to the current page (depending on the [floating parameters](https://tex.stackexchange.com/q/39017/277964)) it can be moved to the next page. This seems to be also the case here. Note, that the default placement of `article` if `tbp` (top, bottom, page). So a `figure` somewhere at the page will not be printed, where it has been placed in the source, but only at the top or bottom of this or the next page or at a page on its own. Additionally you've placed the float inside a paragraph. Note, that even if you'd change the float parameters using `\begin{figure}[!htbp]` it would not be printed between “Hello” and “Goodbye” but at first after “Goodbye“, because LaTeX will not print it before the end of the current line. So to have a replacement image between “Hello” and “Goodbye”, I would not only have to change the floating options, but also add a paragraph (empty line) before “Goodbye”: ``` \documentclass{article} \usepackage{graphicx} % Required for inserting images \title{CPSC} \author{} \date{July 2023} \begin{document} \maketitle \section{Question 1} Hello \begin{figure}[!htbp] \centering \includegraphics[width=\linewidth]{example-image} \caption{Daredevil} \label{fig:my_label} \end{figure} Goodbye \end{document} ``` If your image is higher than the replacement `example-image`, you may also need to reduce the size by changing `\includegraphics` option `width=\linewidth`. But if you don't want the image to float, another solution could be to [not use a floating `figure`](https://tex.stackexchange.com/q/8625/277964).
1
https://tex.stackexchange.com/users/277964
692323
321,164
https://tex.stackexchange.com/questions/692048
-2
How may one define a symbol as `\sqsubset` but without the top line, and another symbol as `\sqsubset` but without the bottom line? Edit 1: At this point I use `\[x\bm{\sqsubset} y\longeq x \ \raisebox{-0.1pt}{\rotatebox[origin=c]{270}{L}} \ y\wedge x \ \raisebox{-2pt}{\rotatebox[origin=c]{270}{\reflectbox{L}}} \ y\]` , under graphicx and bm, and amsmath etc. The problem is to have `\raisebox{-0.1pt}{\rotatebox[origin=c]{270}{L}}` and `\raisebox{-2pt}{\rotatebox[origin=c]{270}{\reflectbox{L}}}` as similar as possible to `\bm{\sqsubset}`. The solution I have may be satisfactory, but it is not optimal.
https://tex.stackexchange.com/users/24406
\sqsubset without topline and bottomline
true
You can use a picture. ``` \documentclass{article} \usepackage{amsmath,amssymb} \usepackage{l3draw} \ExplSyntaxOn \dim_new:N \l__sapiens_wd_dim \dim_new:N \l__sapiens_ht_dim \dim_new:N \l__sapiens_dp_dim \dim_new:N \l__sapiens_tot_dim \box_new:N \l__sapiens_base_box \NewDocumentCommand{\genericsq}{m} { \mathrel{ \mathpalette \__sapiens_sq:nn { #1 } } } \cs_new_protected:Nn \__sapiens_sq:nn { \group_begin: \hbox_set:Nn \l_tmpa_box { $\use:c{m@th}#1\sqsubset$ } \dim_set:Nn \l__sapiens_wd_dim { \box_wd:N \l_tmpa_box } \dim_set:Nn \l__sapiens_ht_dim { \box_ht:N \l_tmpa_box } \dim_set:Nn \l__sapiens_dp_dim { \box_dp:N \l_tmpa_box } \dim_set:Nn \l__sapiens_tot_dim { \box_ht:N \l_tmpa_box + \box_dp:N \l_tmpa_box } \hbox_set:Nn \l__sapiens_base_box { { \draw_begin: \draw_linewidth:n { 0.05\l__sapiens_wd_dim } \draw_cap_round: \draw_join_round: \draw_path_moveto:n { 0.1\l__sapiens_wd_dim , \l__sapiens_tot_dim - 0.04\l__sapiens_wd_dim } \draw_path_lineto:n { 0.1\l__sapiens_wd_dim , 0.025\l__sapiens_wd_dim } \draw_path_lineto:n { 0.9\l__sapiens_wd_dim , 0.025\l__sapiens_wd_dim } \draw_path_use_clear:n { stroke } \draw_end: } } \__sapiens_print:n { #2 } \group_end: } \cs_new_protected:Nn \__sapiens_print:n { \str_case:nn { #1 } { {lb}{} {lt} { \box_scale:Nnn \l__sapiens_base_box { 1 } { -1 } \hbox_set:Nn \l__sapiens_base_box { \box_move_up:nn { \l__sapiens_tot_dim } { \box_use:N \l__sapiens_base_box } } } {rb} { \box_scale:Nnn \l__sapiens_base_box { -1 } { 1 } } {rt} { \box_scale:Nnn \l__sapiens_base_box { -1 } { -1 } \hbox_set:Nn \l__sapiens_base_box { \box_move_up:nn { \l__sapiens_tot_dim } { \box_use:N \l__sapiens_base_box } } } } \box_move_down:nn { \l__sapiens_dp_dim } { \box_use:N \l__sapiens_base_box } } \ExplSyntaxOff \NewDocumentCommand{\bsqsubset}{}{\genericsq{lb}} \NewDocumentCommand{\tsqsubset}{}{\genericsq{lt}} \NewDocumentCommand{\bsqsupset}{}{\genericsq{rb}} \NewDocumentCommand{\tsqsupset}{}{\genericsq{rt}} \begin{document} $ A \sqsubset B \bsqsubset C \tsqsubset D \bsqsupset E \tsqsupset F$ $ \sqsubset\bsqsubset \scriptstyle\sqsubset\bsqsubset $ \end{document} ```
2
https://tex.stackexchange.com/users/4427
692333
321,167
https://tex.stackexchange.com/questions/692336
0
I am trying to add an image to my document (`\documentclass[english]{report}`). This is what I wrote: ``` \documentclass[english]{report} \usepackage{graphicx,wrapfig} \begin{document} \begin{wrapfigure}{R}{0.4\textwidth} \centering \includegraphics[width=0.35\textwidth]{example-image-b} \caption{The ACR evaluation table} \label{fig:crea-alb-scale} \end{wrapfigure} \end{document} ``` The image is simply not there. The wrapping works fine, but there is no image or caption. It's not anywhere else in the document either. I tried changing the width, using different image formats, and different placement arguments. I also tried using `\begin{center}`-`\end{center}` or no centering at all. The image doesn't seem to be too big or too small. I read that this kind of issue can occur when the figure is too close to the top or bottom of the page, but I haven't managed to move it. I tried just moving it around in the code and I tried different placement arguments for wrapfigure. What else should I try?
https://tex.stackexchange.com/users/301581
Unable to insert image using wrapfigure
false
For future reference, please always post a fully self-contained example. I have amended your code, like so: ``` \documentclass[english]{report} \usepackage{graphicx,wrapfig} \begin{document} \begin{wrapfigure}{R}{0.4\textwidth} \centering \includegraphics[width=0.35\textwidth]{example-image-b} \caption{The ACR evaluation table} \label{fig:crea-alb-scale} \end{wrapfigure} \end{document} ``` Does that work for you? In that case, try changing `example-image-b` as desired. Leave out the suffix (.png), and pay special attention to the path.
1
https://tex.stackexchange.com/users/26614
692338
321,169
https://tex.stackexchange.com/questions/692336
0
I am trying to add an image to my document (`\documentclass[english]{report}`). This is what I wrote: ``` \documentclass[english]{report} \usepackage{graphicx,wrapfig} \begin{document} \begin{wrapfigure}{R}{0.4\textwidth} \centering \includegraphics[width=0.35\textwidth]{example-image-b} \caption{The ACR evaluation table} \label{fig:crea-alb-scale} \end{wrapfigure} \end{document} ``` The image is simply not there. The wrapping works fine, but there is no image or caption. It's not anywhere else in the document either. I tried changing the width, using different image formats, and different placement arguments. I also tried using `\begin{center}`-`\end{center}` or no centering at all. The image doesn't seem to be too big or too small. I read that this kind of issue can occur when the figure is too close to the top or bottom of the page, but I haven't managed to move it. I tried just moving it around in the code and I tried different placement arguments for wrapfigure. What else should I try?
https://tex.stackexchange.com/users/301581
Unable to insert image using wrapfigure
false
There is no optional argument `[h]` for `wrapfigure`: ``` \documentclass[english]{report} \usepackage{wrapfig} \usepackage[demo]{graphicx} \usepackage{blindtext} \begin{document} \begin{wrapfigure}{R}{0.4\textwidth} \centering \includegraphics[width=0.35\textwidth]{Pictures/crea-alb-scale.png} \caption{The ACR evaluation table} \label{fig:crea-alb-scale} \end{wrapfigure} \blindtext \end{document} ```
2
https://tex.stackexchange.com/users/187802
692339
321,170
https://tex.stackexchange.com/questions/692336
0
I am trying to add an image to my document (`\documentclass[english]{report}`). This is what I wrote: ``` \documentclass[english]{report} \usepackage{graphicx,wrapfig} \begin{document} \begin{wrapfigure}{R}{0.4\textwidth} \centering \includegraphics[width=0.35\textwidth]{example-image-b} \caption{The ACR evaluation table} \label{fig:crea-alb-scale} \end{wrapfigure} \end{document} ``` The image is simply not there. The wrapping works fine, but there is no image or caption. It's not anywhere else in the document either. I tried changing the width, using different image formats, and different placement arguments. I also tried using `\begin{center}`-`\end{center}` or no centering at all. The image doesn't seem to be too big or too small. I read that this kind of issue can occur when the figure is too close to the top or bottom of the page, but I haven't managed to move it. I tried just moving it around in the code and I tried different placement arguments for wrapfigure. What else should I try?
https://tex.stackexchange.com/users/301581
Unable to insert image using wrapfigure
false
The issue was fixed by moving the image in a completely different place in the code. I had tried moving it before, but I guess I didn't move it far enough.
0
https://tex.stackexchange.com/users/301581
692342
321,171
https://tex.stackexchange.com/questions/19906
4
I want to enclose my path (contains some spaces) with double quotes. I have tried pressing shift+' on English keyboard, but unfortunately TeXStudio translates this as two single quotes. Shortly speaking, how to insert a double quote mark in TeXStudio? --- Update: TeXMakerX has changed its name to TeXStudio.
https://tex.stackexchange.com/users/2099
How to insert a double quote mark in TeXStudio?
false
I know this is a dozen years old, but I stumbled across it when I was trying to figure out why my editor *wasn't* swapping my double quote for the two single quotes. To toggle double quote replacement on/off: Options > Configure TeXstudio > Editor There's an option here called "Replace Double Quotes:" You can pick "No Replacement" to remove the auto-replace, or choose whichever punctuation is correct for your application (currently I'm seeing English, French, German, French Quotes (babel), Reverse French Quotes, Package csquotes, English (unicode), Polish, and Polish (unicode))
0
https://tex.stackexchange.com/users/207269
692347
321,174
https://tex.stackexchange.com/questions/692295
1
I am required to use a .cls (minimized code below) which produces this warning: **Package tocloft Warning: @starttoc has already been redefined; tocloft bailing out. on input line 1156.** Any thoughts on how I can potentially remove this warning is appreciated. I'm using overleaf.com (compiler == pdfLaTeX, TeX Live version == 2022) The error log is posted below. ``` \documentclass[nopardent]{test} \begin{document} \chapter{Introduction} \end{document} ``` Here is the minimal test.cls file ``` \ProvidesClass{test}[TEST class] \newcommand{\classfile}{report} \DeclareOption{nopardent}{\renewcommand{\classfile}{rapport3}} \ProcessOptions\relax \LoadClass[a4paper,openright,titlepage]{\classfile} \RequirePackage[titles]{tocloft} ``` This is the error log file: ``` This is pdfTeX, Version 3.141592653-2.6-1.40.24 (TeX Live 2022) (preloaded format=pdflatex 2022.8.9) 30 JUL 2023 17:20 entering extended mode \write18 enabled. %&-line parsing enabled. **test.tex (./test.tex LaTeX2e <2022-06-01> patch level 5 L3 programming layer <2022-08-05> (./test.cls Document Class: test TEST class (/usr/local/texlive/2022/texmf-dist/tex/latex/ntgclass/rapport3.cls Document Class: rapport3 2020-11-17 v2.1e NTG LaTeX document class (/usr/local/texlive/2022/texmf-dist/tex/latex/ntgclass/ntg10.clo File: ntg10.clo 2020-11-17 v2.1e NTG LaTeX file (size option) ) \unitindent=\dimen138 \othermargin=\dimen139 \c@part=\count185 \c@chapter=\count186 \c@section=\count187 \c@subsection=\count188 \c@subsubsection=\count189 \c@paragraph=\count190 \c@subparagraph=\count191 \c@figure=\count192 \c@table=\count193 \abovecaptionskip=\skip47 \belowcaptionskip=\skip48 LaTeX Info: Redefining \em on input line 818. \bibindent=\dimen140 )) (/usr/local/texlive/2022/texmf-dist/tex/latex/tocloft/tocloft.sty Package: tocloft 2017/08/31 v2.3i parameterised ToC, etc., typesetting Package tocloft Info: The document has chapter divisions on input line 51. \cftparskip=\skip49 \cftbeforetoctitleskip=\skip50 \cftaftertoctitleskip=\skip51 \cftbeforepartskip=\skip52 \cftpartnumwidth=\skip53 \cftpartindent=\skip54 \cftbeforechapskip=\skip55 \cftchapindent=\skip56 \cftchapnumwidth=\skip57 \cftbeforesecskip=\skip58 \cftsecindent=\skip59 \cftsecnumwidth=\skip60 \cftbeforesubsecskip=\skip61 \cftsubsecindent=\skip62 \cftsubsecnumwidth=\skip63 \cftbeforesubsubsecskip=\skip64 \cftsubsubsecindent=\skip65 \cftsubsubsecnumwidth=\skip66 \cftbeforeparaskip=\skip67 \cftparaindent=\skip68 \cftparanumwidth=\skip69 \cftbeforesubparaskip=\skip70 \cftsubparaindent=\skip71 \cftsubparanumwidth=\skip72 \cftbeforeloftitleskip=\skip73 \cftafterloftitleskip=\skip74 \cftbeforefigskip=\skip75 \cftfigindent=\skip76 \cftfignumwidth=\skip77 \c@lofdepth=\count194 \c@lotdepth=\count195 \cftbeforelottitleskip=\skip78 \cftafterlottitleskip=\skip79 \cftbeforetabskip=\skip80 \cfttabindent=\skip81 \cfttabnumwidth=\skip82 Package tocloft Warning: \@starttoc has already been redefined; tocloft bailing out. on input line 1156. ) (/usr/local/texlive/2022/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def ```
https://tex.stackexchange.com/users/269765
using @starttoc causes Package tocloft Warning: \@starttoc has already been redefined;
true
The `tocloft` package checks to see whether the `\@starttoc` command has been redefined by comparing it with the kernel command. The only difference between the standard version of the command and the one defined in `rapport3` is the addition of a `\parskip\z@`. So we can undo that change before loading `tocloft` and then reimplement it afterwards: ``` \documentclass{rapport3} \usepackage{etoolbox} \makeatletter \patchcmd{\@starttoc}{\parskip\z@}{}{}{\fail} \makeatletter \usepackage{tocloft} \patchcmd{\@starttoc}{\makeatletter}{\makeatletter\parskip\z@}{}{\fail} \makeatother \begin{document} \end{document} ``` Inside a class file you don't need `\makeatletter` / `\makeatother`. So your minimal class file could look something like this: ``` \ProvidesClass{test}[TEST class] \newcommand{\classfile}{report} \DeclareOption{nopardent}{\renewcommand{\classfile}{rapport3}} \ProcessOptions\relax \LoadClass[a4paper,openright,titlepage]{\classfile} \RequirePackage{etoolbox} \patchcmd{\@starttoc}{\parskip\z@}{}{}{\fail} \RequirePackage[titles]{tocloft} \patchcmd{\@starttoc}{\makeatletter}{\makeatletter\parskip\z@}{}{\fail} % rest of class file here \endinput % end of class file ```
2
https://tex.stackexchange.com/users/2693
692348
321,175
https://tex.stackexchange.com/questions/692340
0
I'm just asking if it is possible to insert LaTeX into a social networking app? If so, how?
https://tex.stackexchange.com/users/301582
How to insert LaTeX into an application
false
If you are simply talking about LaTeX code without the possibility of having it typeset into input, you can include that just about anywhere because it is usually only ASCII characters, occasionally accompanied by Unicode characters. As far as I currently know, including a full LaTeX implementation into something like a social media platform has not been done and indeed may not be possible. The reason is rather deceptive in that many developers say they "support LaTeX" when in fact what they really mean is that they support a LaTeX-like command syntax (i.e. commands that begin with a backslash character). This alone does not mean actual LaTeX is in use. I elaborate on this in my answer <https://tex.stackexchange.com/a/648198/218142>. As an example from social media, consider the [Mathstodon.xyz](https://mathstodon.xyz/about) instance. The term "LaTeX" is advertised but it really uses [MathJax](https://www.mathjax.org/), a JavaScript library that indeed mimics a lot of LaTeX's capability. You can examine the source code for Mathstodon on their GitHub home <https://github.com/christianp/mastodon>. Similarly, [Jupyter Notebook](https://jupyter.org/) sometimes claims support for LaTeX, but it too uses MathJax. You can export a notebook to TeX, but I have never experimented with that and have no idea how good the generate code is. Still, processing that code requires a local TeX Live (or similar) installation. Using actual LaTeX requires an extensive backend including a processing engine. On my current TeX Live 2023 installation, the `pdftex` engine is 5.3MB in size and that engine would need to be present somewhere in the machinery for every user to make use of it. If you count WordPress blogs as "social media" then I know of one plugin that does indeed use an actual LaTeX distribution, [Quick LaTeX](https://www.holoborodko.com/pavel/quicklatex/). It works by piping the LaTeX markup to a server where it is processed natively by a TeX Live distribution and then returned to the blog as an image. Still, unlike the other systems I describe it allows for LaTeX packages and genuine LaTeX markup. This model may be worth looking into but I have no knowledge about whether or not it would scale to a social media platform with millions of users. The only large scale software package I use, and that I am aware of, that uses a locally installed LaTeX distribution is [Manim Community](https://www.manim.community/), a fork of the Python-based animation system used by [3Blue1Brown](https://www.3blue1brown.com/). Indeed, it requires a local TeX Live or other suitable TeX/LaTeX distribution (I haven't tested it with MikTeX). In summary, due to the extensive backend requirements, to my knowledge it is not (yet?) possible to integrate full LaTeX capability into something like a social media platform. I hope someone someday finds a way to do it because I think it would be immensely useful.
3
https://tex.stackexchange.com/users/218142
692350
321,177
https://tex.stackexchange.com/questions/692346
1
The following is a command that does basic arithmetic with nine variables. ``` \documentclass{article} \usepackage{xfp} \newcommand\functesta[9]{ \edef\myvara{#1} \edef\myvarb{#2} \edef\myvarc{#3} \edef\myvard{#4} \edef\myvare{#5} \edef\myvarf{#6} \edef\myvarg{#7} \edef\myvarh{#8} \edef\myvari{#9} $\inteval{\myvara + \myvarb - \myvarc + \myvard - \myvare + \myvarf - \myvarg + \myvarh - \myvari}$ } \begin{document} \functesta{1}{2}{3}{4}{5}{6}{7}{8}{100} \end{document} ``` ``` -94 ``` I tried shrinking the nine lines of definition into one for loop but it didn't work. My intention was that as a loop iterates through 1 to 9, it would expand `\alphalph{\iteration}` first, which would be combined with `\myvarx` to become `\myvarxa`, `\myvarxb`, ..., `\myvarxi`. In the same way `#\iteration` would expand to `#1` to `#9`. However I probably got the syntax wrong. ``` \documentclass{article} \usepackage{xfp} \usepackage{pgffor} \usepackage{alphalph} \newcommand\functestb[9]{ \foreach \iteration in {1,...,9} { \edef\expandafter\myvarx\alphalph{\iteration}{#\iteration} } $\inteval{\myvarxa + \myvarxb - \myvarxc + \myvarxd - \myvarxe + \myvarxf - \myvarxg + \myvarxh - \myvarxi}$ } \begin{document} \functestb{1}{2}{3}{4}{5}{6}{7}{8}{100} \end{document} ``` ``` ! Illegal parameter number in definition of \functestb. ``` Then I replaced `#\iteration` with a constant to see if I got the rest of the code right. Nope. What is the right way to achieve what I want? The reason I am not directly accessing `#1` to `#9` is because I will write a more complex command in which the nine numbers given need to be saved and changed multiple times. I am open to alternatives such as passing a list as a parameter or generating a list inside the command if it is possible to do so in LaTeX. ``` \documentclass{article} \usepackage{xfp} \usepackage{pgffor} \usepackage{alphalph} \newcommand\functestb[9]{ \foreach \iteration in {1,...,9} { \edef\expandafter\myvarx\alphalph{\iteration}{17} } $\inteval{\myvarxa + \myvarxb - \myvarxc + \myvarxd - \myvarxe + \myvarxf - \myvarxg + \myvarxh - \myvarxi}$ } \begin{document} \functestb{1}{2}{3}{4}{5}{6}{7}{8}{100} \end{document} ``` ``` ! Undefined control sequence. ```
https://tex.stackexchange.com/users/301588
How to control expansion order to define variables from a prefix and a command?
false
This probably isn't how I would do this, but you could use `\pgffor`'s facility to expand the list of arguments and just count them. ``` \documentclass{article} \usepackage{xfp} \usepackage{pgffor} \usepackage{alphalph} \newcommand\functesta[9]{% \edef\myvara{#1}% \edef\myvarb{#2}% \edef\myvarc{#3}% \edef\myvard{#4}% \edef\myvare{#5}% \edef\myvarf{#6}% \edef\myvarg{#7}% \edef\myvarh{#8}% \edef\myvari{#9}% $\inteval{\myvara + \myvarb - \myvarc + \myvard - \myvare + \myvarf - \myvarg + \myvarh - \myvari}$% } \newcommand\functestb[9]{% \foreach [count=\ino,expand list=true] \iteration in {#1,#2,#3,#4,#5,#6,#7,#8,#9} {% \xdef is needed as we want to use the definitions outside the loop \expandafter\xdef\csname myvarx\alphalph{\ino}\endcsname{\iteration}% }% $\inteval{\myvarxa + \myvarxb - \myvarxc + \myvarxd - \myvarxe + \myvarxf - \myvarxg + \myvarxh - \myvarxi}$% } \begin{document} \functestb{1}{2}{3}{4}{5}{6}{7}{8}{100} \functesta{1}{2}{3}{4}{5}{6}{7}{8}{100} \end{document} ```
1
https://tex.stackexchange.com/users/39222
692356
321,182
https://tex.stackexchange.com/questions/692275
1
Been away for ~10 days -- came home to find a couple of packages on my LaTeX install (MikTeX latest, Win 10 pro) needed updating, including newtx, which I use as the primary font for many of my documents. I tried compiling a document that pre-upgrade compiled without warning/error. But, post-update, I now get the following when rendering from the .ps -> .pdf file using ps2pdf: ``` Querying operating system for font files... Can't find (or can't open) font file %rom%Resource/Font/%rom%R. Can't find (or can't open) font file ntxsym. Didn't find this font on the system! Substituting font Courier for ntxsym. ``` Did a quick search, and was surprised to find not a single mention of 'font file ntxsym' anywhere. So, perhaps *not* surprised ps2pdf couldn't find the font file, since even the almighty and omnipotent Google search engine hasn't either. ;-) Any suggestions? Thanks in advance...
https://tex.stackexchange.com/users/16184
can't find "ntxsym" font file
false
In this case, the problem as described arose as an artifact of changes in how newtx interprets/uses AMS symbol arguments I was passing to newtx. I had been successfully using the following as part of my preamble (my larger documents usually have anywhere from 20-30 packages involved, so sussing out weird interactions can be time consuming). ``` % use AMS math package for more control over equations \usepackage{amsmath,amssymb} \usepackage{mathtools} % use following for better formed clones of Times \usepackage{newtxtext} \usepackage[cmintegrals,cmbraces,nosymbolsc]{newtxmath} \usepackage[scr=rsfso]{mathalfa} ``` The problem was that recent changes to newtx, in particular newtexmath which supports its own AMS symbol set,conflicted in some funky way with the amssymb package. So, tweak ``` \usepackage[cmintegrals,cmbraces,nosymbolsc]{newtxmath} ``` to ``` \usepackage[cmintegrals,cmbraces,noamssymbols]{newpxmath} ``` and...problem solved.
1
https://tex.stackexchange.com/users/16184
692358
321,183
https://tex.stackexchange.com/questions/692329
1
When compiling ``` \documentclass{article} \pagestyle{empty} % No page numbers \usepackage{geometry} \geometry{a4paper} \usepackage{tikz} \usepackage[object=pgfhan]{pgfornament} \begin{document} \begin{tikzpicture}[remember picture, overlay] every node/.style={inner sep=0pt}] % corners \node[anchor=north east] at (current page.north east) {\pgfornament[width=5cm,symmetry=v]{4}}; \node[anchor=north west] at (current page.north west) {\pgfornament[width=5cm]{4}}; \node[anchor=south east] at (current page.south east) {\pgfornament[width=5cm,symmetry=c]{4}}; \node[anchor=south west] at (current page.south west) {\pgfornament[width=5cm,symmetry=h]{4}}; % borders \node[anchor=north,xscale=2.2] at (current page.north) {\pgfornament[height=2.5mm]{30}}; \node[anchor=south,xscale=2.2] at (current page.south) {\pgfornament[height=2.5mm,symmetry=c]{30}}; \node[anchor=east,shift={(-2.5mm,-10.5cm)},yscale=4,rotate=-90] at (current page.east) {\pgfornament[height=2.5mm]{30}}; \node[anchor=west,shift={(2.5mm,-10.5cm)},yscale=4,rotate=90] at (current page.west) {\pgfornament[height=2.5mm]{30}}; \end{tikzpicture} \end{document} ``` with `xelatex` version `XeTeX 3.14159265-2.6-0.999992 (TeX Live 2020/Debian)`, I have the following problems: * the vertical borders are not perfectly aligned * I can't use psutils release 1 patchlevel 17 prior to use pdftops `gs` can read the PDF file correctly, but not `pstops` nor `psresize`. The PDF file prints, but cropped (expected behavior). Using `pdf2ps` helps. It makes the file compatible with `pstops`, but I have to specify the paper size to avoid cropping the top border: ``` pdf2ps -paper=A4 frame-2.pdf frame-2.ps ``` Using `pstops "@0.8(21mm,29.7mm)" -pA4 frame-2.ps frame-2ss.ps` produces a file that * prints as desired on A4 paper. * is not shown properly centered by `gs`. Is my `AVlinux` system `Linux 6.0.0-10.1-liquorix-amd64 #1 ZEN SMP PREEMPT_DYNAMIC liquorix 6.0-6~mx21+1 (2022-11-30) x86_64 GNU/Linux` not set to default A4 paper size?
https://tex.stackexchange.com/users/282677
pgfornament alignment not perfect and psutils incompatible
false
You can align them correctly with pdfTeX, XeTeX or LuaTeX using the `pgfornament` package: ``` \documentclass[a4paper]{article} \pagestyle{empty} % No page numbers \usepackage{geometry} \usepackage{tikz} \usepackage[object=pgfhan]{pgfornament} \begin{document} \begin{tikzpicture}[remember picture, overlay, every node/.style={inner sep=0pt}] % corners \node[anchor=north east] at (current page.north east) {\pgfornament[width=5cm,symmetry=v]{4}}; \node[anchor=north west] at (current page.north west) {\pgfornament[width=5cm]{4}}; \node[anchor=south east] at (current page.south east) {\pgfornament[width=5cm,symmetry=c]{4}}; \node[anchor=south west] at (current page.south west) {\pgfornament[width=5cm,symmetry=h]{4}}; % borders \node[anchor=north,xscale=2.2] at (current page.north) {\pgfornament[height=2.5mm]{30}}; \node[anchor=south,xscale=2.2] at (current page.south) {\pgfornament[height=2.5mm,symmetry=c]{30}}; \node[anchor=south,yscale=4,rotate around={-90:(current page.west)}] at (current page.west) {\pgfornament[height=2.5mm]{30}}; \node[anchor=south,yscale=4,rotate around={90:(current page.east)}] at (current page.east) {\pgfornament[height=2.5mm]{30}}; \end{tikzpicture} \end{document} ```
0
https://tex.stackexchange.com/users/39222
692359
321,184
https://tex.stackexchange.com/questions/692346
1
The following is a command that does basic arithmetic with nine variables. ``` \documentclass{article} \usepackage{xfp} \newcommand\functesta[9]{ \edef\myvara{#1} \edef\myvarb{#2} \edef\myvarc{#3} \edef\myvard{#4} \edef\myvare{#5} \edef\myvarf{#6} \edef\myvarg{#7} \edef\myvarh{#8} \edef\myvari{#9} $\inteval{\myvara + \myvarb - \myvarc + \myvard - \myvare + \myvarf - \myvarg + \myvarh - \myvari}$ } \begin{document} \functesta{1}{2}{3}{4}{5}{6}{7}{8}{100} \end{document} ``` ``` -94 ``` I tried shrinking the nine lines of definition into one for loop but it didn't work. My intention was that as a loop iterates through 1 to 9, it would expand `\alphalph{\iteration}` first, which would be combined with `\myvarx` to become `\myvarxa`, `\myvarxb`, ..., `\myvarxi`. In the same way `#\iteration` would expand to `#1` to `#9`. However I probably got the syntax wrong. ``` \documentclass{article} \usepackage{xfp} \usepackage{pgffor} \usepackage{alphalph} \newcommand\functestb[9]{ \foreach \iteration in {1,...,9} { \edef\expandafter\myvarx\alphalph{\iteration}{#\iteration} } $\inteval{\myvarxa + \myvarxb - \myvarxc + \myvarxd - \myvarxe + \myvarxf - \myvarxg + \myvarxh - \myvarxi}$ } \begin{document} \functestb{1}{2}{3}{4}{5}{6}{7}{8}{100} \end{document} ``` ``` ! Illegal parameter number in definition of \functestb. ``` Then I replaced `#\iteration` with a constant to see if I got the rest of the code right. Nope. What is the right way to achieve what I want? The reason I am not directly accessing `#1` to `#9` is because I will write a more complex command in which the nine numbers given need to be saved and changed multiple times. I am open to alternatives such as passing a list as a parameter or generating a list inside the command if it is possible to do so in LaTeX. ``` \documentclass{article} \usepackage{xfp} \usepackage{pgffor} \usepackage{alphalph} \newcommand\functestb[9]{ \foreach \iteration in {1,...,9} { \edef\expandafter\myvarx\alphalph{\iteration}{17} } $\inteval{\myvarxa + \myvarxb - \myvarxc + \myvarxd - \myvarxe + \myvarxf - \myvarxg + \myvarxh - \myvarxi}$ } \begin{document} \functestb{1}{2}{3}{4}{5}{6}{7}{8}{100} \end{document} ``` ``` ! Undefined control sequence. ```
https://tex.stackexchange.com/users/301588
How to control expansion order to define variables from a prefix and a command?
false
I'm not sure you need to name variables. ``` \documentclass{article} %\usepackage{xfp} % no longer needed \usepackage{alphalph} \ExplSyntaxOn \NewDocumentCommand\functesta{mm} { \tl_set:Nn \l_tmpa_tl { #1 } \regex_replace_all:nnN { \cP\#([0-9]+) } % find #<digits> { \c{seq_item:Nn} \c{l_tmpa_seq} \cB\{\1\cE\} } % replace with the seq item \l_tmpa_tl % make the sequence from the input \seq_set_from_clist:Nn \l_tmpa_seq { #2 } % evaluate $\int_eval:n { \tl_use:N \l_tmpa_tl }$ } \ExplSyntaxOff \begin{document} \functesta{#1+#2-#3+#4-#5+#6-#7+#8-#9}{1,2,3,4,5,6,7,8,100} \functesta{(#1*#2+#3*#4)*#5}{1,2,3,4,5} \functesta{#1+#2+#3+#4+#5+#6+#7+#8+#9+#10+#11}{1,2,3,4,5,6,7,8,9,10,11} \end{document} ``` As you see, the function gets any definition you like and the values are given as a list. The trick is to replace `#<digits>` with `\seq_item:N \l_tmpa_tl { <digits> }`, so we have a syntax similar, but not restricted to nine parameters, to a macro definition.
0
https://tex.stackexchange.com/users/4427
692361
321,186
https://tex.stackexchange.com/questions/692362
3
I have the following beamer slide: ``` \documentclass[10pt]{beamer} \usepackage{tikz} \usepackage{pgfplots} \begin{document} \begin{frame} \begin{figure}[h] \centering \begin{tikzpicture} \begin{axis}[ ] \addplot[dashed, const plot mark left] coordinates { (0, 0) (1, 0) (2, 0) (3, 0) (4, 0) (5, 0) (6, 0) (7, 5) (8, 7) (9, 0) (10, 0) (11, 0) (12, 0) (13, 0) (14, 0) }; \end{axis} \end{tikzpicture} \end{figure} \end{frame} \end{document} ``` I want to have the plot shift to the right by 1 unit when I advance to the "next slide", but I want to keep the same slide number. I could somehow fake this effect by having a bunch of continuous frames, where I just increase all the `x` coordinates in my plot by 1 unit, but there must be a better way. Can someone suggest things that I can look into?
https://tex.stackexchange.com/users/213060
How to "animate" a pgfplot picture to slide in a beamer slide
true
You can use the `overlay-beamer-styles` library and use overlays to keep the same *frame number*: ``` \documentclass[10pt]{beamer} \usepackage{tikz} \usepackage{pgfplots} \usetikzlibrary{overlay-beamer-styles} \begin{document} \begin{frame} \begin{figure} \begin{tikzpicture} \begin{axis}[ ] \addplot[ dashed, const plot mark left, alt=<2>{xshift=0.4cm}{}, alt=<3>{xshift=0.8cm}{} ] coordinates { (0, 0) (1, 0) (2, 0) (3, 0) (4, 0) (5, 0) (6, 0) (7, 5) (8, 7) (9, 0) (10, 0) (11, 0) (12, 0) (13, 0) (14, 0) }; \end{axis} \end{tikzpicture} \end{figure} \end{frame} \end{document} ``` (the value of `0.4cm` -- and multiples thereof -- might need fine tuning, this was just a rough guess)
5
https://tex.stackexchange.com/users/36296
692364
321,187
https://tex.stackexchange.com/questions/543755
7
I try to make just a very minimalist example of pgfkeys — or other keystyle parameters package —, with a command like this one: ``` \mycommand{title="The new book", author="John Doe"} ``` to get a behavior like this: > > **Writer** John Doe > > > **Title** *The new book* > > > And, possibly, if on key is missing, it line will not appear. For example, the command ``` \mycommand{title="The new book"} ``` Will only print: > > **Title** *The new book* > > > I check in the web and also StackExchange but I only find very complicated examples including so much other things not directly related to key-value syntax. So, how can I just put such a minimal key-value command?
https://tex.stackexchange.com/users/30933
Simple key-value example
false
With `expkv-cs` minimal key=value macros are very easy to implement. In this case we may also want different behaviour if a key was given or not. This can be achieved relatively easy by one level of indirection, where the first level contains the default value if nothing was supplied, and the second level adds markup/formatting instructions if a key was used. This way we don't need any tests in the macro replacement but can directly use the values (even if they are empty). For this purpose the following uses `-internal` for the real keys, but adds wrappers around those which add stuff like `\par\noindent` or similar. ``` \documentclass[]{article} \usepackage{expkv-cs} % declaring the internal keys and the order of output. \ekvcSplit\mycommand { % long since it'll get a `\par` token by the frontend key long author-internal = {} % #1 , title-internal = \emph{No title} % #2 ,long year-internal = {} % #3 } {#1\par\noindent#2#3} % Declaring the front level keys and how they interact with the internal keys. % A meta key will set other keys, so if `year=YYYY` is called it'll be % equivalent to `year-internal=\par\noindent\textbf{Year} YYYY` \ekvcSecondaryKeys\mycommand { % for a single key=value pair set by a `meta` secondary key we don't need % additional braces guarding the second = in expkv. The following is % equivalent to % meta author = {author-internal = {\par\noindent\textbf{Writer} #1}} meta author = author-internal = {\par\noindent\textbf{Writer} #1} ,meta title = title-internal = {\textbf{Title} #1} ,meta year = year-internal = {\par\noindent\textbf{Year} #1} } \begin{document} \mycommand{title=The new book,author=John Doe} \bigskip \mycommand{title=The new book} \bigskip \mycommand{title=The new book,year=2020} \bigskip \mycommand{author=John Doe,year=2020} \end{document} ```
1
https://tex.stackexchange.com/users/117050
692370
321,189
https://tex.stackexchange.com/questions/692367
1
If an `\item` (in `\begin{enumerate`) contains a long line, I need to add a linebreak so the rest goes to another line (but with the same enumeration number). In the following code, I add `\allowbreak` in hoping to break the rest into a new line, but it does not work. How do I do it? Thanks. ``` \begin{enumerate} \item $T(\phi_{1}(x)\barwedge\left(\phi_{2}(y)\veebar\phi_{3}(z)\right))\,=\,T(\left(\phi_{1}(x)\barwedge\phi_{2}(y) \right) \veebar\left(\phi_{1}(x)\barwedge\phi_{3}(z)\right))$, \quad\allowbreak $T(\phi_{1}(x)\veebar \left(\phi_{2}(y)\barwedge\phi_{3}(z)\right))\,=\, T(\left(\phi_{1}(x)\veebar\phi_{2}(y)\right)\barwedge \left(\phi_{1}(x)\veebar\phi_{3}(z)\right))$. \end{enumerate} ```
https://tex.stackexchange.com/users/75077
How to add a new line in item list
true
If you just want a linebreak, you can add that with `\\` instead of `\quad\allowbreak`. If you want to have two list items with the same number, you can set it using `\item\setcounter{enumi}{1}` where "1" should be a number one less than what you would like. Here's an MWE with all both options: ``` \documentclass[]{article} \usepackage{amsmath} \usepackage{amssymb} \begin{document} \begin{enumerate} \item $T(\phi_{1}(x)\barwedge\left(\phi_{2}(y)\veebar\phi_{3}(z)\right))\,=\,T(\left(\phi_{1}(x)\barwedge\phi_{2}(y) \right) \veebar\left(\phi_{1}(x)\barwedge\phi_{3}(z)\right))$\\$T(\phi_{1}(x)\veebar \left(\phi_{2}(y)\barwedge\phi_{3}(z)\right))\,=\, T(\left(\phi_{1}(x)\veebar\phi_{2}(y)\right)\barwedge \left(\phi_{1}(x)\veebar\phi_{3}(z)\right))$. \end{enumerate} \hrule \begin{enumerate} \item\setcounter{enumi}{0} $T(\phi_{1}(x)\barwedge\left(\phi_{2}(y)\veebar\phi_{3}(z)\right))\,=\,T(\left(\phi_{1}(x)\barwedge\phi_{2}(y) \right) \veebar\left(\phi_{1}(x)\barwedge\phi_{3}(z)\right))$ \item $T(\phi_{1}(x)\veebar \left(\phi_{2}(y)\barwedge\phi_{3}(z)\right))\,=\, T(\left(\phi_{1}(x)\veebar\phi_{2}(y)\right)\barwedge \left(\phi_{1}(x)\veebar\phi_{3}(z)\right))$. \item This is the third item \item This is the fourth item \end{enumerate} \hrule \begin{enumerate} \item This is the first item \item This is the second item \item\setcounter{enumi}{2} $T(\phi_{1}(x)\barwedge\left(\phi_{2}(y)\veebar\phi_{3}(z)\right))\,=\,T(\left(\phi_{1}(x)\barwedge\phi_{2}(y) \right) \veebar\left(\phi_{1}(x)\barwedge\phi_{3}(z)\right))$ \item $T(\phi_{1}(x)\veebar \left(\phi_{2}(y)\barwedge\phi_{3}(z)\right))\,=\, T(\left(\phi_{1}(x)\veebar\phi_{2}(y)\right)\barwedge \left(\phi_{1}(x)\veebar\phi_{3}(z)\right))$. \item This is the fourth item \item This is the fifth item \end{enumerate} \end{document} ``` I've included two version of the `\setcounter\enumi{}` option to give you a better idea of how it works.
1
https://tex.stackexchange.com/users/245702
692371
321,190
https://tex.stackexchange.com/questions/692366
3
I have a problem using powerdot with siunitx. A minimal example is as follows: ``` \documentclass[style=simple,mode=print]{powerdot} \usepackage{siunitx} \begin{document} \end{document} ``` This generates the Error `! LaTeX Error: Key 'siunitx/number-mode' accepts only a fixed set of choices.` From the log file, it appears that importing `amsgen.sty` triggers the error, but that's not under my control. Can I do anything, or is this a problem for the author of powerdot?
https://tex.stackexchange.com/users/89225
Problem with powerdot and siunitx
true
The problem arises because both `powerdot` and `siunitx` have a class/package option `mode`. Since the `powerdot` option must be passed as a class option (it doesn't seem to be able to be set using the `\pdsetup` command), then you need to undo that option before loading the `siunitx` package. This can be done by emptying the internal macro that stores the class options: ``` \documentclass[mode=print,style=simple]{powerdot} \makeatletter\let\@raw@classoptionslist\relax\makeatother \usepackage{siunitx} \title{A title} \author{An author} \date{A date} \begin{document} \maketitle \end{document} ```
4
https://tex.stackexchange.com/users/2693
692372
321,191
https://tex.stackexchange.com/questions/692362
3
I have the following beamer slide: ``` \documentclass[10pt]{beamer} \usepackage{tikz} \usepackage{pgfplots} \begin{document} \begin{frame} \begin{figure}[h] \centering \begin{tikzpicture} \begin{axis}[ ] \addplot[dashed, const plot mark left] coordinates { (0, 0) (1, 0) (2, 0) (3, 0) (4, 0) (5, 0) (6, 0) (7, 5) (8, 7) (9, 0) (10, 0) (11, 0) (12, 0) (13, 0) (14, 0) }; \end{axis} \end{tikzpicture} \end{figure} \end{frame} \end{document} ``` I want to have the plot shift to the right by 1 unit when I advance to the "next slide", but I want to keep the same slide number. I could somehow fake this effect by having a bunch of continuous frames, where I just increase all the `x` coordinates in my plot by 1 unit, but there must be a better way. Can someone suggest things that I can look into?
https://tex.stackexchange.com/users/213060
How to "animate" a pgfplot picture to slide in a beamer slide
false
If the plot changes, underlying data must change as well. Underlying data can be filtered with `x filter/.expression={}` to achieve this. There is no need for manual adjustment if proper data are plotted instead of shifting the graph on the `tikzpicture` level. ``` \documentclass[10pt]{beamer} \usepackage{tikz} \usepackage{pgfplots} \begin{document} \begin{frame} \foreach \i in {1,...,7} {\only<\i>{% \begin{figure} \begin{tikzpicture} \begin{axis}[ ] \addplot[ dashed, const plot mark left, unbounded coords=jump, x filter/.expression={x+\i-1>14 ? nan : x+\i-1} ] coordinates { (-\i+1, 0) (0, 0) (1, 0) (2, 0) (3, 0) (4, 0) (5, 0) (6, 0) (7, 5) (8, 7) (9, 0) (10, 0) (11, 0) (12, 0) (13, 0) (14, 0) }; \end{axis} \end{tikzpicture} \end{figure} }} \end{frame} \end{document} ```
3
https://tex.stackexchange.com/users/1053
692374
321,193
https://tex.stackexchange.com/questions/692376
1
I'm new to LaTeX and was doing a simple proof: ``` \begin{proof} \begin{align*} ***arbitrary proof \end{align*} \end{proof} ``` when I recompile, I get the \qed box in the bottom right. What can I do to customize that and have it say QED instead, if that's a possibility?
https://tex.stackexchange.com/users/301598
How would you change the qed box icon to just QED for a proof?
true
Assuming you employ the `amsthm` package, you may achieve your formatting objective by redefining the `\qedsymbol` macro suitably. ``` \documentclass{article} \usepackage{amsthm} \renewcommand\qedsymbol{{\footnotesize\textsc{qed}}} \begin{document} \begin{proof} bla bla bla \end{proof} \end{document} ```
0
https://tex.stackexchange.com/users/5001
692378
321,194
https://tex.stackexchange.com/questions/692381
3
I work with a small company (10 people). I've been a LaTeX user for roughly 20 years. We have been trying to implement LaTeX as the primary document preparation system in our company with varying levels of success. The group of people who usually end up preparing documents (proposals, reports, invoices, letters, etc.) are all familiar with LaTeX. We need to prepare documents that can be shipped both in PDF form and in printed form. The company has a standard letterhead (a header and footer) with which documents should be prepared. All documents go in this letterhead. The PDF is shipped on email. Then the same document is printed on pre-printed stationery and sent across, when required. We started by implementing a package that will generate the headers based on a custom command in the document source (something like `\GenerateForPrint`). We used `fancyhdr` for this. Lately we adopted KOMA-script, because of the flexibility. While going through the KOMA-script docs, we figured that we were implementing this as a bunch of hacks that muck with things like page dimensions and margins. We have had problems in the past with our "package", which we now realise is because of these crude hacks we put in. We want to understand the right way of doing this. How should the base template be? Should it be a package or a document class or? We want this "base template" to be version controlled so that improvements can be shared across the team. We do not want to put the whole thing in the preamble of the main document source.
https://tex.stackexchange.com/users/301601
LaTeX for Companies
false
So basically your documents are usually in a letter format, correct? (Not the legal/letter paper size, but a real, old-school letter, possibly in A4 format. Correct me, if I am wrong.) There are multiple ways to do this, obviously. How extensive und numerous are your commands? A package is basically just a collection of (La)TeX commands, so this might be an obvious choice. That said, KOMA letters (Are you using either `scrletter` or `scrlttr2`?) support so-called `.lco`files, which can be loaded at run time, like so: ``` \LoadLetterOption{myprint} %\LoadLetterOption{myemail} ``` … which would import `~/texmf/tex/latex/myprint.lco` by default. This allows for a quick and relatively painless implementation of a coherent corporate identity. Take a look at this [commented example from Washington State University](https://github.com/komascript/notepaper-wsu/tree/main) to get an idea and get you started.
1
https://tex.stackexchange.com/users/26614
692384
321,195
https://tex.stackexchange.com/questions/648196
4
What's the difference between different LaTeX versions like TeX Live, KaTex Mac TeX etc? There are so many of them but I don't really see a difference.
https://tex.stackexchange.com/users/199920
What's the difference between different LaTeX versions like LiveTex, KaTex MacTex etc?
false
TeX live isn't "LaTeX verison", it is a **TeX distribution**. It includes TeX interpreter (in various modifications: pdfTeX, XeTeX, LuaTeX) and additional software: macros, fonts, drivers, additional tools. One of such additional software is LaTeX: a set of macros used by TeX interpreters. TeX is able to read macros. When a TeX interpreter reads a set of LaTeX macros then somebody calls it as LaTeX interpreter. But there are various different sets of macros for TeX: plain TeX, OpTeX, ConTeXt. There is no only LaTeX. All this software is part of the TeX live distribution. MacTeX is another TeX distribution. KaTeX and MathJax have no common with TeX, they only use TeX-like syntax for math formulas in html language.
4
https://tex.stackexchange.com/users/51799
692388
321,196
https://tex.stackexchange.com/questions/692387
0
While designing a custom title page for a beamer presentation I want to position a logo in the top right corner using the same marging like the rest of the page. According to the [beamer documentation](https://www.ctan.org/pkg/beamer) page 76 the default value for the left/right margin size is 1cm. But I don't want to rely on a default value, I want to use whichever value might have been set with `\setbeamersize{text margin right=whatever}`. Ideally I would want to do this: ``` \hspace*{\getbeamersize{text margin right}}% ``` But there is no command `\getbeamersize`. How do I get the margin in a document using the beamer class? --- I am using something similar to the following code to insert the logo: ``` \begingroup \setbeamertemplate{footline}{} \setbeamertemplate{headline}{% \begin{minipage}{\paperwidth}% \vspace*{1cm}% \hfill \includegraphics[height=1.5cm]{logo}% \hspace*{1cm}% \end{minipage}% } \begin{frame} ... \end{frame} \endgroup ```
https://tex.stackexchange.com/users/120953
How to get a beamer size?
true
Beamer stores these values in `\beamer@leftmargin` and `\beamer@rightmargin`: ``` \documentclass{beamer} \begin{document} \begingroup \makeatletter \setbeamertemplate{footline}{} \setbeamertemplate{headline}{% \begin{minipage}{\paperwidth}% \vspace*{\beamer@leftmargin}% \hfill \includegraphics[height=1.5cm]{example-image-duck}% \hspace*{\beamer@rightmargin}% \end{minipage}% } \makeatother \begin{frame} ... \end{frame} \endgroup \end{document} ```
2
https://tex.stackexchange.com/users/36296
692390
321,197
https://tex.stackexchange.com/questions/692400
-2
%Equation 1 ``` \begin{equation} E(\textit{p},\textit{a},\textit{b})=\Big\{(\textit{x},\textit{y}) | \textit{x},\textit{y} \in\mathbb{Z_\textit{p},\textit{y^2}=\textit{x^3}+\textit{ax}+\textit{b},\mod\textit{p}}\Big} \end{equation} ```
https://tex.stackexchange.com/users/301623
What is the error(s) in this latex code for ECC equation?
false
In general, inside `math` the `alpha numerals` are in `italic` and `arabic` numerals are in `roman`, so no need to give `\textit` for each alpha characters, and the modified `MWE` is: ``` \documentclass{book} \usepackage{amsmath,amssymb} \begin{document} \begin{equation} E(p,a,b)=\Big\{(x,y) | x,y \in\mathbb{Z}_{p},y^2=x^3+ax+b,\mod p\Big\} \end{equation} \end{document} ``` As you didn't mention the class file name, hence I've used the standard one
3
https://tex.stackexchange.com/users/121024
692401
321,201
https://tex.stackexchange.com/questions/692400
-2
%Equation 1 ``` \begin{equation} E(\textit{p},\textit{a},\textit{b})=\Big\{(\textit{x},\textit{y}) | \textit{x},\textit{y} \in\mathbb{Z_\textit{p},\textit{y^2}=\textit{x^3}+\textit{ax}+\textit{b},\mod\textit{p}}\Big} \end{equation} ```
https://tex.stackexchange.com/users/301623
What is the error(s) in this latex code for ECC equation?
false
You have two obvious errors: ``` \mathbb{Z_\textit{p} ``` lacks a closing brace and, at the end, ``` \Big} ``` lacks a backslash before `}`. However, you should be aware that LaTeX allows for much easier input: letters will be in italics in math mode without any special instruction. ``` \documentclass{article} \usepackage{amsmath,amssymb} \begin{document} \begin{equation} E(p,a,b)=\bigl\{(x,y) \mid x,y \in \mathbb{Z}_{p},y^2=x^3+ax+b\bigr\} \end{equation} \end{document} ``` I don't see reasons for specifying “mod *p*”, as you're working in the integers modulo *p* to begin with. Also `\Big` size is too big for this case.
7
https://tex.stackexchange.com/users/4427
692402
321,202
https://tex.stackexchange.com/questions/692405
2
Packages can specify that they need a specific version of LaTeX using [`\NeedsTeXFormat`](https://tex.stackexchange.com/questions/160802/what-date-should-i-specify-in-the-optional-argument-of-needstexformat), which takes something like `LaTeX2e`, and an optional release-date which the latex-version used must be newer than. Since packages cannot specify an exact release date or an "older-than" release date, can I download the newest release of the specified LaTeX-version (e.g. `LaTeX2e`) and have a guarantee that all packages that NeedTeXFormat `LaTeX2e` work with this? In other words, do releases of LaTex-versions have backward compatibility? Also, according to [this answer here](https://tex.stackexchange.com/a/13550/293514), when I compile a document with say pdflatex, it uses a file `latex.ltx`. Am I right in assuming that the latex-version and release date one can specify in `\NeedsTeXFormat` refers to the version and release date of the `latex.ltx` file?
https://tex.stackexchange.com/users/293514
Do packages work only with a specific version of LaTeX?
true
There are literally thousands of packages on ctan many have not changed for decades and have worked with all latex releases over that time. Some sometimes need to adjust to a change in the format. It all depends. Most packages using `\NeedsTeXFormat` do so as they use a new command not available in older formats, but they expect to work for later formats, and that is what the command checks, it does not check that a format with exactly that date is in use, just that a format no later than that date is in use.
5
https://tex.stackexchange.com/users/1090
692413
321,208
https://tex.stackexchange.com/questions/692416
1
I am using `pgfplots` to display a stacked bar chart. For each x-value, two bars are stacked. I need to show the y-value inside each bar and their sum on top. I managed to achieve this, however, the first bar is too short to correctly display the inside value. **For the first bar only**, I would like to show only the sum on top while hiding the values inside. I have no idea how to make such an exception for the first bar only. [bar chart](https://i.stack.imgur.com/4ECtE.png) This is the code: ``` \begin{tikzpicture} \pgfplotsset{ selective show sum on top/.style={ /pgfplots/scatter/@post marker code/.append code={% \ifnum\coordindex=#1 \node[ at={(normalized axis cs:% \pgfkeysvalueof{/data point/x},% \pgfkeysvalueof{/data point/y})% }, anchor=south, ] {\pgfmathprintnumber{\pgfkeysvalueof{/data point/y}}}; \fi }, },selective show sum on top/.default=0 } \begin{axis}[% ybar stacked, ymin=0, bar width=24pt, xtick=data, nodes near coords, ylabel=Run time (s), xlabel=$T$, major x tick style = transparent, enlarge x limits=0.15, legend cell align={left}, legend style={ at={(0.02,0.885)}, anchor=west, column sep=1ex } ] \addplot [fill=blue!60] coordinates { (0,2) (1,150) (2,300) (3,450) }; \addplot [fill=red!60,selective show sum on top/.list={0,1,2,3}] coordinates { (0,1) (1,75) (2,150) (3,225) }; \legend{Computation,Communication} \end{axis} \end{tikzpicture} ```
https://tex.stackexchange.com/users/301638
Tikz bar chart, nodes near coords, remove value from a specific bar
true
You could add `coordinate style/.condition={x==0}{transparent}` to the `axis` options which would render the labels for the first bar invisible (but they will be still selectable in the PDF). Alternatively, you could define a custom function that only prints the `nodes at coords` if the `\coordindex` is not `0`: ``` \documentclass[border=10pt]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=newest} \begin{document} \begin{tikzpicture} \pgfplotsset{ selective show sum on top/.style={ /pgfplots/scatter/@post marker code/.append code={% \ifnum\coordindex=#1 \node[ at={(normalized axis cs:% \pgfkeysvalueof{/data point/x},% \pgfkeysvalueof{/data point/y})% }, anchor=south, ] {\pgfmathprintnumber{\pgfkeysvalueof{/data point/y}}}; \fi }, }, selective show sum on top/.default=0 } \begin{axis}[% ybar stacked, ymin=0, bar width=24pt, xtick=data, nodes near coords={ \ifnum\coordindex=0\else \pgfmathprintnumber\pgfplotspointmeta \fi }, ylabel=Run time (s), xlabel=$T$, major x tick style=transparent, enlarge x limits=0.15, legend cell align={left}, legend style={ at={(0.02,0.885)}, anchor=west, column sep=1ex }, ] \addplot [fill=blue!60] coordinates { (0,2) (1,150) (2,300) (3,450) }; \addplot [fill=red!60, selective show sum on top/.list={0,1,2,3}] coordinates { (0,1) (1,75) (2,150) (3,225) }; \legend{Computation, Communication} \end{axis} \end{tikzpicture} \end{document} ```
0
https://tex.stackexchange.com/users/47927
692417
321,209
https://tex.stackexchange.com/questions/563513
7
I was wondering if there is a detailed documentation of `moderncv` package. Here in [ctan](https://ctan.org/pkg/moderncv) no detailed documentation was provided by the author. Where I can get a complete list of all the commands provided by this package?
https://tex.stackexchange.com/users/206031
Moderncv detailed documentation
false
There is now a link to the package documentation in CTAN: <http://mirrors.ctan.org/macros/latex/contrib/moderncv/manual/moderncv_userguide.pdf>
2
https://tex.stackexchange.com/users/1128
692428
321,212
https://tex.stackexchange.com/questions/671031
2
I am confronted to a long-proof problem like in [this question](https://tex.stackexchange.com/questions/66532/proofs-in-beamer), which entails breaking a block between two frames, and also to the problem that I am creating an article and I do not want the proof environment to be broken there, like in [that closed question](https://tex.stackexchange.com/questions/153395/). How can I combine both ideas ?
https://tex.stackexchange.com/users/103608
Break block between two frames in presentation but not in article mode
true
Here is a more elegant solution, using lua to hide the frame-splitting code from LaTeX in article mode. ``` \RequirePackage{luacode} \begin{luacode*} envname = "" current = "" function startGobble(cur, fut) envname = fut current = cur luatexbase.add_to_callback("process_input_buffer", gobble, "gobbler") end function gobble(line) if line:find("\\begin{"..envname.."}") ~= nil then luatexbase.remove_from_callback("process_input_buffer", "gobbler") luatexbase.add_to_callback("process_input_buffer", replace, "replacer") return "\\refstepcounter{framenumber}" else return "" end end function replace(line) if line:find("\\end{"..envname.."}") ~= nil then luatexbase.remove_from_callback("process_input_buffer", "replacer") return line:gsub("\\end{"..envname.."}", "\\end{"..current.."}") else return line end end \end{luacode*} \mode <presentation> \NewDocumentCommand{\mergeFrame}{mm}{} \mode <article> \NewDocumentCommand{\mergeFrame}{mm}{\luadirect{startGobble("#1", "#2");}} \mode <all> ``` We can then say ``` \NewDocumentEnvironment{preuve}{O{Preuve}}{\begin{block}{#1}}{\end{block}} \begin{document} \begin{frame} \begin{alertblock}{Berge, 1957} Un couplage $C$ est de cardinal maximal si et seulement s'il n'admet pas de chemin augmentant. \end{alertblock} \pause \begin{preuve}[Preuve du sens non couvert par le lemme] some already long text \mergeFrame{preuve}{block} \end{preuve} \end{frame} \begin{frame} \begin{block}{} Soit $p$ un chemin maximal dans $K$ : \uncover<2->{sa première et sa dernière arêtes sont dans $C_2$.} \end{block} Remarque : ce lemme et ce théorème n'utilisent pas le fait que le graphe est biparti.\\ Cette propriété va cependant permettre de faciliter la recherche d'un chemin augmentant. \end{frame} \end{document} ``` In presentation mode, the `\mergeFrame` does nothing. In article mode, it sets up a line-gobbler until it sees `\begin{block}` (included). It then lets the content show up, until it sees `\end{block}`, which it replaces with `\end{preuve}`. Therefore, in article mode, LaTeX saw a single `preuve` environment. We `\refstepcounter{framenumber}` when going out from gobbling mode, although this should not be very relevant in article mode.
0
https://tex.stackexchange.com/users/103608
692429
321,213
https://tex.stackexchange.com/questions/692430
0
My goal is to quote two paragraphs using the `amsart` document style, with both paragraphs in the quotation being formatted in ordinary paragraph style, i.e. with the crown line indented. The LaTeX Book on p. 26 says that the "quotation" environment is for quoting material that is entire paragraphs, and shows an example with the formatting I desire. The [AMS-LaTeX guide](http://homepages.math.uic.edu/%7Ehurder/math589/TeX/amshelp.pdf) does not describe quotations at all. Testing shows that in `amsart` the "quotation" environment does not indent the first line of the quotation, but if the quotation contains an empty line the first line following it will be indented. That is, the first paragraph is not paragraph-formatted but the second paragraph is paragraph-formatted. (The "quote" environment produces the same formatting, contra the LaTeX Book which says that "quote" is for non-paragraph-formatted text.) Presumably there is a known way to do this but I haven't been able to find the documentation.
https://tex.stackexchange.com/users/285657
How to quote multiple paragraphs in amsart?
false
It's a deliberate choice of `amsart` ``` % amsart.cls, line 892: \newenvironment{quotation}{\list{}{% \leftmargin3pc \listparindent\normalparindent \itemindent\z@ \rightmargin\leftmargin \parsep\z@ \@plus\p@}% \item[]% }{% \endlist } ``` The instruction `\itemindent\z@` is what makes the first paragraph not to be indented. ``` \documentclass{amsart} \usepackage{xpatch} \makeatletter \xpatchcmd{\quotation}{\z@}{\normalparindent}{}{} \makeatother \begin{document} This is the first paragraph and we want that it is indented like every other paragraph. Some more text just to see what happens. \begin{quotation} This is the first quoted paragraph and we want that it is indented like every other paragraph. Some more text just to see what happens. This is the second quoted paragraph and we want that it is indented like every other paragraph. Some more text just to see what happens. \end{quotation} This is the final paragraph and we want that it is indented like every other paragraph. Some more text just to see what happens. \end{document} ```
1
https://tex.stackexchange.com/users/4427
692431
321,214
https://tex.stackexchange.com/questions/692422
0
I have a long table that doesn't extend to the next page. I am using a journal template. I tried using `longtable` but it didn't work. I tried `table`, `tabularx` and `longtable` but it didn't work as it doesn't adjust the width properly. The table stays on one page and half of the table disappears. Kindly check my code and let me know what is the mistake. Thank you very much in advance. ``` \begin{longtable}{\fulllength}{CCCCCCCC} %\begin{table}[H] \begin{adjustwidth}{-\extralength}{0cm} \newcolumntype{C}{>{\centering\arraybackslash}X} %\begin{tabularx}{\fulllength}{CCCCCCCC} \toprule \textbf{Sensing material} & \textbf{Structure type} & \textbf{Fabrication technique} & \textbf{Temperature (\textdegree C)} & \textbf{VOCs detected} & \textbf{Detection range} & \textbf{Data analysis technique} & \textbf{Ref.}\\ \midrule SnO\textsubscript{2} and WO\textsubscript{3} & Villi-like nano structure & Electron beam evaporation & 212 & nitrogen oxide, ammonia, ethanol, acetone, toluene, benzene, carbon monoxide, & 899 ppt – 10 ppm & PCA & \cite{RN5229}\\ \midrule MOS (NiO, CuO, Cr\textsubscript{2}O\textsubscript{3}, SnO\textsubscript{2} and WO\textsubscript{3}) & Nano pattern of multi-array sensing & Lithography & 380 & toluene, nitrogen oxide, ammonia, ethanol, acetone, hexane, propanol & 5 ppm & PCA & \cite{RN5230}\\ \midrule SnO\textsubscript{2} & Nanowire gradient & Vapor solid method & 326 & isopropyl alcohol, ethanol, carbon monoxide & 2 – 10 ppm & LDA & \cite{RN5133}\\ \midrule Pd/SnO\textsubscript{2} & Nanowire sensor array & Vapor solid & 150 & isopropyl alcohol & 1 – 50 ppm & LDA & \cite{RN5134}\\ \midrule TiO\textsubscript{2}, SnO\textsubscript{2}, ITO, WO\textsubscript{3} & Nanorod array & Oblique angle deposition & 250 & hydrogen, carbon monoxide, nitrogen dioxide & 10 – 200 ppm & - & \cite{RN5132}\\ \midrule Si-SiO\textsubscript{2}, Pd-SiO\textsubscript{2}, Pt-SiO\textsubscript{2}, Ti-SiO\textsubscript{2} & Microwire sensor chip & Flexible flame spray pyrolysis & 400 & formaldehyde, acetone, ethanol, ammonia & 3 ppb & - & \cite{RN483}\\ \midrule WO\textsubscript{3} & Nanofibers & Electrospinning & 350 & hydrogen sulfide, acetone & 1 – 5 ppm & PCA & \cite{RN5131}\\ \midrule Cu\textsubscript{2}O & Nanospheres & silanization & 180 & ethanol, ethylacetate, toluene, hexane, tetrahydrofuran & 25 – 200 ppm & PCA & \cite{RN5231}\\ \midrule Gold & Nano-islands & In-situ iterative seeding and growth & RT & acetone, ethanol, propionaldehyde, acetophenone, benzyl alcohol, benzaldehyde & 1 – 1000 ppm & PCA & \cite{RN5232}\\ \midrule Pt, Pd-doped SnO\textsubscript{2}/RGO & Nanohybrids & Hydrothermal & 180 & hydrogen, hydrogen sulfide, nitrogen dioxide & 0.04 – 40 ppm & PCA, LDA, Hierarchical Cluster Analysis & \cite{RN5233}\\ \midrule Thermo-cycled MOS sensors & MOS films & Thermal deposition & 260 - 290 & hexane, butyl acetate & 50 – 175 ppm & - & \cite{RN287}\\ \midrule Commercial PEN3, CAPINose & TGS sensors & - & RT & ethanol & 10 vol.\% & Average resistance & \cite{RN286}\\ \midrule SnO\textsubscript{2}, WO\textsubscript{3}, ZnO, In\textsubscript{2}O\textsubscript{3} & Nanofilms & Screen printing & 26 - 426 & formaldehyde, carbon monoxide, nitrogen dioxide, toluene, ammonia & 0.6 – 1000 ppm & - & \cite{RN276}\\ \midrule ZnTiO\textsubscript{3} & Nanoarrays & Hydrothermal, CVD & 350 & acetone & 1.2 – 12.5 ppm & - & \cite{RN296}\\ \midrule Au/SnO\textsubscript{2}, Pt/SnO\textsubscript{2}, Ni/SnO\textsubscript{2}, ITO/SnO\textsubscript{2} & Multiplexed nanotube arrays & Spray pyrolysis & RT & hydrogen, benzene, nitrogen dioxide & 50 – 4000 ppm & LVA & \cite{RN5224}\\ \midrule Warwick OLFaction (WOLF) E-nose & MEMS MOS-based commercial thick and thin film sensors & - & RT & acetone, 1-propanol, iso-propanol, iso-butylene & 2 – 10 ppm & PCA & \cite{RN120}\\ \midrule Pt, Cu, and Ag decorated TiO\textsubscript{2} and ZnO functionalized GaN & Nanowire & Lithography, CVD, Chemical Etching & RT & nitrogen dioxide, sulfur dioxide, hydrogen, ethanol & 0.1 – 10000 ppm & PCA, SVM, k-NN, Decision Tree & \cite{RN5237}\\ \midrule Au decorated WO\textsubscript{3}, SnO\textsubscript{2} and NiO & Thin films, nanostructures & electron-beam evaporation & 100 – 300 & acetone, toluene, ammonia, hydrogen sulfide & 10 ppm & PCA & \cite{RN5238}\\ \midrule Commercial MOS sensors & TGS sensors & - & RT & ethanol, acetone & - & partial least squares discriminant analysis & \cite{RN5239}\\ \midrule Commercial MOS sensors & TGS Sensors & - & RT & nitrogen dioxide, carbon monoxide & 0 – 50 ppm & PCA, C-means clustering, back propagation neural network & \cite{RN5240}\\ \midrule Pure and Fe-doped In\textsubscript{2}O\textsubscript{3} & nanofibers & Electrospinning & 250 – 450 & benzene, xylene, toluene, ethanol, formaldehyde & 0.1 – 1000 ppm & PCA & \cite{RN5137}\\ \bottomrule %\end{tabularx} \end{adjustwidth} %\noindent{\footnotesize{* Tables may have a footer.}} %\end{table} \end{longtable} ```
https://tex.stackexchange.com/users/301650
LaTeX table does not extend to the next page
true
I strongly recommend you load the [xltabular](https://www.ctan.org/pkg/xltabular) package and employ its eponymous environment, which combines the capabilities of the `longtable` and `tabularx` environments. And, by all means, do load a package such as [mhchem](https://www.ctan.org/pkg/mhchem) and start writing chemical compound names in a streamlined and easy-to-read fashion. E.g., `\ce{Cr2O3}` instead of `Cr\textsubscript{2}O\textsubscript{3}`. Finally, I see no need for all those heavy-handed `\midrule` directives; visual separation via `\addlinespace` directives works at least as well. You didn't indicate which document class you employ or how wide and tall the textblock is. The following code therefore uses the defaults for the basic `article` document class. Do please indicate which document class you employ. ``` \documentclass{article} % or some other suitable document class \usepackage[T1]{fontenc} \usepackage[english]{babel} %% define some additional hyphenation points: \hyphenation{di-oxide hydro-thermal mon-oxide micro-wire nano-arrays nano-fi-bers nano-films nano-hybrids nano-spheres nano-struc-tures nano-tube nano-wire nano-wires prop-anol} \usepackage{amsmath} % for '\nobreakdash' macro \usepackage{mhchem} % for '\ce' macro \usepackage{xltabular,ragged2e,booktabs} % column type that suppresses full justificaiton, but allows hyphenation: \newcolumntype{L}{>{\RaggedRight\hspace{0pt}}X} \begin{document} \setlength\tabcolsep{2.5pt} % default: 6pt \begin{xltabular}{\textwidth}{@{} LLLL LLL l @{}} %% headers and footers \toprule Sensing material & Structure type & Fabrication technique & Temperature (\textdegree C) & VOCs detected & Detection range & Data analysis technique & Ref.\\ \midrule \endhead \midrule \multicolumn{8}{r@{}}{\footnotesize (\textit{cont'd on following page})}\\ \endfoot \bottomrule \endlastfoot %% body of table \ce{SnO3} and \ce{WO3} & Villi-like nano structure & Electron beam evaporation & 212 & nitrogen oxide, ammonia, ethanol, acetone, toluene, benzene, carbon monoxide, & 899 ppt--10 ppm & PCA & \cite{RN5229}\\ \addlinespace MOS (\ce{NiO}, \ce{CuO}, \ce{Cr2O3}, \ce{SnO3} and \ce{WO3}) & Nano pattern of multi-array sensing & Lithography & 380 & toluene, nitrogen oxide, ammonia, ethanol, acetone, hexane, propanol & 5 ppm & PCA & \cite{RN5230}\\ \addlinespace \ce{SnO3} & Nanowire gradient & Vapor solid method & 326 & isopropyl alcohol, ethanol, carbon monoxide & 2--10 ppm & LDA & \cite{RN5133}\\ \addlinespace \ce{Pd}\slash \ce{SnO3} & Nanowire sensor array & Vapor solid & 150 & isopropyl alcohol & 1--50 ppm & LDA & \cite{RN5134}\\ \addlinespace \ce{TiO2}, \ce{SnO3}, ITO, \ce{WO3} & Nanorod array & Oblique angle deposition & 250 & hydrogen, carbon monoxide, nitrogen dioxide & 10--200 ppm & -- & \cite{RN5132}\\ \addlinespace \ce{Si}-\ce{SiO2}, \ce{Pd}-\ce{SiO2}, \ce{Pt}-\ce{SiO2}, \ce{Ti}-\ce{SiO2} & Microwire sensor chip & Flexible flame spray pyrolysis & 400 & formaldehyde, acetone, ethanol, ammonia & 3 ppb & -- & \cite{RN483}\\ \addlinespace \ce{WO3} & Nanofibers & Electrospinning & 350 & hydrogen sulfide, acetone & 1--5 ppm & PCA & \cite{RN5131}\\ \addlinespace \ce{Cu2O} & Nanospheres & silanization & 180 & ethanol, ethylacetate, toluene, hexane, tetrahydrofuran & 25--200 ppm & PCA & \cite{RN5231}\\ \addlinespace Gold & Nano-islands & In-situ iterative seeding and growth & RT & acetone, ethanol, propionaldehyde, acetophenone, benzyl alcohol, benzaldehyde & 1--1000 ppm & PCA & \cite{RN5232}\\ \addlinespace \ce{Pt}, \ce{Pd}-doped \ce{SnO3}\slash RGO & Nanohybrids & Hydrothermal & 180 & hydrogen, hydrogen sulfide, nitrogen dioxide & 0.04--40 ppm & PCA, LDA, Hierarchical Cluster Analysis & \cite{RN5233}\\ \addlinespace Thermo-cycled MOS sensors & MOS films & Thermal deposition & 260--290 & hexane, butyl acetate & 50--175 ppm & -- & \cite{RN287}\\ \addlinespace Commercial PEN3, CAPINose & TGS sensors & -- & RT & ethanol & 10 vol.\% & Average resistance & \cite{RN286}\\ \addlinespace \ce{SnO3}, \ce{WO3}, \ce{ZnO}, \ce{In2O3} & Nanofilms & Screen printing & 26--426 & formaldehyde, carbon monoxide, nitrogen dioxide, toluene, ammonia & 0.6--1000 ppm & -- & \cite{RN276}\\ \addlinespace \ce{ZiTiO3} & Nanoarrays & Hydrothermal, CVD & 350 & acetone & 1.2--12.5 ppm & -- & \cite{RN296}\\ \addlinespace \ce{Au}\slash \ce{SnO3}, \ce{Pt}\slash \ce{SnO3}, \ce{Ni}\slash \ce{SnO3}, ITO\slash \ce{SnO3} & Multiplexed nanotube arrays & Spray pyrolysis & RT & hydrogen, benzene, nitrogen dioxide & 50--4000 ppm & LVA & \cite{RN5224}\\ \addlinespace Warwick OLFaction (WOLF) E-nose & MEMS MOS-based commercial thick and thin film sensors & -- & RT & acetone, 1\nobreakdash-\hspace{0pt}propanol, iso-propanol, iso-butylene & 2--10 ppm & PCA & \cite{RN120}\\ \addlinespace \ce{Pt}, \ce{Cu}, and \ce{Ag} decorated \ce{TiO2} and \ce{ZnO} functionalized \ce{GaN} & Nanowire & Lithography, CVD, Chemical Etching & RT & nitrogen dioxide, sulfur dioxide, hydrogen, ethanol & 0.1--10000 ppm & PCA, SVM, k-NN, Decision Tree & \cite{RN5237}\\ \addlinespace Au decorated \ce{WO3}, \ce{SnO3} and \ce{NiO} & Thin films, nanostructures & electron-beam evaporation & 100--300 & acetone, toluene, ammonia, hydrogen sulfide & 10 ppm & PCA & \cite{RN5238}\\ \addlinespace Commercial MOS sensors & TGS sensors & -- & RT & ethanol, acetone & -- & partial least squares discriminant analysis & \cite{RN5239}\\ \addlinespace Commercial MOS sensors & TGS Sensors & -- & RT & nitrogen dioxide, carbon monoxide & 0--50 ppm & PCA, \mbox{C-means} clustering, back propagation neural network & \cite{RN5240}\\ \addlinespace Pure and \ce{Fe}-doped \ce{In2O3} & Nanofibers & Electrospinning & 250--450 & benzene, xylene, toluene, ethanol, formaldehyde & 0.1--1000 ppm & PCA & \cite{RN5137}\\ \end{xltabular} \end{document} ```
2
https://tex.stackexchange.com/users/5001
692438
321,218
https://tex.stackexchange.com/questions/692444
0
I don't want to remove the navigation bar, I just want to insert a new symbol before it. I'm using the following snippet to add the frame number of the total frames in the navigation bar, but it is rendered in the bottom right and I wanted to be centered with the frame. ``` \addtobeamertemplate{navigation symbols}{}{% \usebeamerfont{footline}% \usebeamercolor[fg]{footline}% \hspace{1mm} \insertframenumber\ of\ \inserttotalframenumber } ```
https://tex.stackexchange.com/users/217339
Is it possible to insert a navigation symbol before the standard navigation bar in beamer?
true
You could manually add some space to move the navigation symbols towards the centre: ``` \documentclass{beamer} \addtobeamertemplate{navigation symbols}{ symbol before }{% \usebeamerfont{footline}% \usebeamercolor[fg]{footline}% \hspace{1mm} \insertframenumber\ of\ \inserttotalframenumber \hspace{3.4cm} } \begin{document} \section{title 1} \begin{frame} test \end{frame} \end{document} ```
1
https://tex.stackexchange.com/users/36296
692447
321,221
https://tex.stackexchange.com/questions/692443
9
Both `ltluatex.tex` (from the LaTeX kernel) and `luatexbase.sty` (as an add-on package) share the same Lua namespace, namely `luatexbase`; they also share functions with the same name. However, these functions are not compatible – in particular, `luatexbase.add_to_callback` differs. What is the recommended, future-proof way to find out whether the stuff from `ltluatex.tex` is used? Or to say it differently, I want to reject `luatexbase.sty`.
https://tex.stackexchange.com/users/20911
`ltluatex.tex` vs. `luatexbase.sty`
true
As with any latex package you can prevent it loading via ``` \@namedef{ver@luatexbase.sty}{} ``` so latex thinks it is already loaded. But there should be no need The current `luatexbase.sty` was written at the same time as `ltluatex`, by the same people, it is intended as a compatible extension, replacing the original `luatexbase.sty` that pre-dates `ltluatex`. The extended `luatexbase.add_to_callback` has an extra optional `priority` argument but if it is not used, the behaviour is as in `ltluatex` and either way the actual registering of the callback is done via the `ltluatex` version (saved as `luatexbase.base_add_to_callback`). The extended version just re-orders the callback list if `priority` is used. All the internal tables recording the callbacks are the ones defined by `ltluatex`.
8
https://tex.stackexchange.com/users/1090
692449
321,223
https://tex.stackexchange.com/questions/663260
1
Consider the following class: ``` % CLASS % Preamble \NeedsTeXFormat{LaTeX2e}[1994/06/01] \ProvidesClass{myclass}[2022/10/11] \LoadClass[varwidth]{standalone} \makeatletter % Pgfoptions \RequirePackage{pgfopts} \pgfkeys{ /myclass/.cd, optionA/.store in = \myclass@optionA, optionA = , optionB/.store in = \myclass@optionB, optionB = \myclass@optionA, } \ProcessPgfOptions{/myclass} \newcommand{\setA}[1]{\pgfkeyssetvalue{/myclass/optionA}{#1}\texttt{setA(#1)}\\} \newcommand{\setB}[1]{\pgfkeyssetvalue{/myclass/optionB}{#1}\texttt{setB(#1)}\\} \newcommand{\defineA}[1]{\pgfkeys{/myclass/optionA = #1}\texttt{defineA(#1)}\\} \newcommand{\defineB}[1]{\pgfkeys{/myclass/optionB = #1}\texttt{defineB(#1)}\\} \newcommand{\printoptions}{\fbox{\texttt{% [A = (\pgfkeysvalueof{/myclass/optionA}, \myclass@optionA)]% [B = (\pgfkeysvalueof{/myclass/optionB}, \myclass@optionB)] }}\\} \makeatother ``` used in the code: ``` \documentclass[optionA = A0]{myclass} \begin{document} \printoptions % => [A = (, A0)] [B = (, A0)] \setA{A1} \printoptions % => [A = (A1, A0)] [B = (, A0)] \defineA{A2} \printoptions % => [A = (A1, A2)] [B = (, A2)] \setB{B1} \printoptions % => [A = (A1, A2)] [B = (B1, A2)] \defineB{B2} \printoptions % => [A = (A1, A2)] [B = (B1, A2)] \end{document} ``` --- There are many things I do not understand: **QUESTION 0:** Why does `\pgfkeyssetvalue{/myclass/optionX}{#1}` and `\pgfkeys{/myclass/optionX = #1}` lead to different results? **QUESTION 1:** Why printing `\pgfkeysvalueof{/myclass/optionX}` and `\myclass@optionX` lead to different results while I would expect the `.store in` to make the two equivalent? **QUESTION 2:** Why `defineA(A2)` change also the value of `\myclass@optionB`? I would have expected the `optionB = \myclass@optionA` during the definition of `pgfkeys` to just be an initialization instead of having a permanent link between the two. **QUESTION 3:** Is there a way to define the `pgfkeys` to that `\pgfkeysvalueof{/myclass/optionX}` and `\myclass@optionX` are synonymous always correspond to the same value, including for example a change through `\pgfkeyssetvalue{/myclass/optionX}` or a `\pgfkeys{/myclass/optionX = XN}`? **QUESTION 4:** How to initialize the `pgfkeys` so that `optionB = \myclass@optionA` only initialize `\myclass@optionB` with the value of `\myclass@optionA` (but if `\myclass@optionA` is changed later, it does not change the value given by `\myclass@optionB`) as in: ``` \printoptions % => [A = (, A0)] [B = (, A0)] \setA{A1} \printoptions % => [A = (A1, A0)] [B = (, A0)] \defineA{A2} \printoptions % => [A = (A1, A2)] [B = (, A0)] % Difference here: B stays the same!!!! \setB{B1} \printoptions % => [A = (A1, A2)] [B = (B1, A0)] \defineB{B2} \printoptions % => [A = (A1, A2)] [B = (B1, A0)] ``` More generally, I think I am missing the big picture of what is going behind the association of `pgfkeys` and `macros`, so any big picture explanation will be appreciated.
https://tex.stackexchange.com/users/17200
Pgfkeys associated with macros lead to unexpected results
false
This attempts to be the "big picture" answer, even though this answer just focuses on a single aspect of `pgfkeys`, namely how to store values given to keys for later use: `.store in` and `\pgfkeyssetvalue`/`.initial`. In general `pgfkeys` has two ways to store values: 1. Storing the value inside the key path 2. Storing the value in some macro You can achieve the first by using the `.initial` handler to define the key (`\pgfkeys{/foo/.initial = 1}`), and then access the value by using `\pgfkeysvalueof` or `\pgfkeysgetvalue`. This simply hides the macro in a non-obvious name and adds a level of indirection, the advantage being that the same name to set the key is used to get its value, instead of another macro name. The second is what `.store in` sets up, so `\pgfkeys{/foo/.store in = \foo}`. This sets things up such that each time the key is set the definition of `\foo` is changed to expand to the given value. The advantage is that you get more control over where stuff is stored, and have an easier life expanding it. The drawback is yet another name for the same thing. When you use `\pgfkeyssetvalue{/foo}{bar}` you're only assigning to the first storage, you don't call the code that was set up by the `.store in` handler, so the assignment is not made to `\foo`, but only to the key path `/foo`. Which of the two you prefer (and which is to be preferred) isn't dictated, `pgfkeys` gives this choice to the user. And while this choice *per se* isn't something bad, it sometimes (like in your case), leads to confusion. I'd advice to select one of the mechanisms and stick to it for one project (that doesn't mean another project by the same author can't use the other approach). Personally I'd prefer the second approach, as I don't see the gain of that level of indirection (and my own key=value implementation -- *advertisement block:* `expkv` -- doesn't support the other). Others (like [@Qrrbrbirlbel](https://tex.stackexchange.com/questions/663260/pgfkeys-associated-with-macros-lead-to-unexpected-results#comment1649757_663260)) prefer the first approach.
1
https://tex.stackexchange.com/users/117050
692450
321,224
https://tex.stackexchange.com/questions/692444
0
I don't want to remove the navigation bar, I just want to insert a new symbol before it. I'm using the following snippet to add the frame number of the total frames in the navigation bar, but it is rendered in the bottom right and I wanted to be centered with the frame. ``` \addtobeamertemplate{navigation symbols}{}{% \usebeamerfont{footline}% \usebeamercolor[fg]{footline}% \hspace{1mm} \insertframenumber\ of\ \inserttotalframenumber } ```
https://tex.stackexchange.com/users/217339
Is it possible to insert a navigation symbol before the standard navigation bar in beamer?
false
Assuming the default theme ... (please post always a minimal working example with all that must be taken into account), you can add the navigations symbols and whatever as a centered footline: ``` \documentclass{beamer} \setbeamertemplate{navigation symbols}{} \addtobeamertemplate{footline}{\color{structure} \centering {\large$\Phi$}\qquad \insertslidenavigationsymbol% \insertframenavigationsymbol% \insertsubsectionnavigationsymbol% \insertsectionnavigationsymbol% \insertdocnavigationsymbol% \insertbackfindforwardnavigationsymbol% \qquad\insertframenumber\ of\ \inserttotalframenumber\medskip\par} \begin{document} \section{title 1} \begin{frame}{Test}{test} test \end{frame} \end{document} ```
0
https://tex.stackexchange.com/users/11604
692454
321,227
https://tex.stackexchange.com/questions/692455
0
Originally, I intended to use the command $\not\mathcal{R}$ as the negation of a binary relation, but there is a problem with that concatenation of commands. So I did what anyone would do in a situation like this, which is create my own symbol.Searching for information on this page, I came across the following code: ``` \newcommand{\TCNegacion}[1]{% \mathrel{\fbox{\ooalign{$#1$\cr\hidewidth\raisebox{0.5ex}{\rotatebox[origin]{80}{\rule{0.5cm}{0.5pt}}}\hidewidth\cr}}} } ``` This code solves the initial problem, but it generates another one, namely the concatenation of commands `$y\TCNegation{\mathcal{T}} g$` is not to my liking. I'd like to rotate it a bit more to better visualize the negation, but I lose the alignment of the characters involved. Is there a better way to fix the initial problem? Is it possible to improve the code?
https://tex.stackexchange.com/users/301449
Is there a problem with the $\not\mathcal{R}$ command?
false
You could tweak this some more but I'd use the slanted `\not` not a rule, with optional per-character offset ``` \documentclass{article} \def\mfudge{4mu} \def\fooA{\def\mfudge{7mu}} \def\fooI{\def\mfudge{1mu}} \def\fooM{\def\mfudge{8mu}} \newcommand\foo[1]{\mathrel{% \csname foo#1\endcsname \mkern\mfudge \not{\mkern-\mfudge\mathcal{#1}}}} \begin{document} $\foo{A}$ $\foo{I}$ $\foo{M}$ $\foo{R}$ $\foo{Z}$ \end{document} ``` --- Two packages offering similar functionality are [slashed](https://ctan.org/pkg/slashed) and [centernot](https://ctan.org/pkg/centernot).
0
https://tex.stackexchange.com/users/1090
692460
321,231
https://tex.stackexchange.com/questions/665946
1
I am creating an image grid with many images by using the PGF `groupplots` library. I am using a for-loop with `\pgfplotsforeachungrouped`. Each filename is structured as follows: `preamble_title_percent.jpg`. I want to extract the title and the percent value by splitting the filename. Consequently, I can use the title and percent as values in `\nextgroupplot`. How can I do it? Unlike an ordinary `\foreach` in PGF, `\pgfplotsforeachungrouped` only works with two arguments. That's why, I guess, it is the only way to extract the title and percent on the fly within `\edef`. Pseudo-code: ``` \pgfplotsforeachungrouped \filename in { preamble_title_percent.jpg } { \edef\temp{ # How can I split the filename here? \def\title{???} \def\percent{???} \noexpand\nextgroupplot[ title=\title, scale only axis, enlargelimits=false, axis on top, xticklabels={}, yticklabels={}, colormap={blackwhite}{[1pt] rgb255(0 pt)=(0, 63, 92); rgb255(\percent pt)=(0, 63, 92); rgb255(16 pt)=(166,188,198); rgb255(20pt)=(166,188,198) }, colorbar, point meta min = 0, point meta max = 20, colorbar style = { at={(0.9,0.65)},anchor=north west, height = 3cm, width = 0.3cm, yticklabel pos=left, yticklabel style = { text width = 2em, align = right, /pgf/number format/.cd, fixed, fixed zerofill, precision = 0, /tikz/.cd } } ] \noexpand\addplot[thick] graphics [ xmin=0, ymin=0, xmax=600, ymax=450 ]{\noexpand\root /\filename}; % } \temp } ```
https://tex.stackexchange.com/users/285335
PGF groupplots - loop through filenames, then split filename for use in plots
true
With `xparse`, which is now built into most TeX distributions, you can use `\SplitArgument` to split an argument at a certain character, including special characters. If we define a `\splitAtUnder` macro for underscores and `\splitAtPeriod` for periods, we can extract both the title and percent value from the name of the file. ``` \documentclass{standalone} %\usepackage{xparse} % uncomment if you have an older TeX distribution \usepackage{pgfplots} \usepgfplotslibrary{groupplots} \pgfplotsset{compat=1.18} \NewDocumentCommand\splitAtUnder {>{\SplitArgument{2}{_}} m}{\assignValues#1} \NewDocumentCommand\splitAtPeriod{>{\SplitArgument{1}{.}} m}{\assignPercent#1} \def\assignValues#1#2#3{ \gdef\subplotTitle{#2} \splitAtPeriod{#3} } \def\assignPercent#1#2{ \gdef\percent{#1} } \begin{document} \begin{tikzpicture} \begin{groupplot}[group style={{group size=2 by 2},vertical sep=2cm}] \pgfplotsforeachungrouped \filename in { example_cat_10.jpg, example_dog_20.jpg, example_duck_30.jpg, example_penguin_40.jpg } { \edef\splitAtUnderAxis{ \splitAtUnder{\filename} } \splitAtUnderAxis \edef\setAxis{ \noexpand\nextgroupplot[ title=\noexpand\bfseries\subplotTitle, colormap={blackwhite}{[1pt] rgb255(0pt) = ( 0, 63, 92); rgb255(\percent pt) = ( 0, 63, 92); rgb255(50pt) = (166,188,198); rgb255(60pt) = (166,188,198); }, ] \noexpand\addplot[thick] graphics[xmin=0,ymin=0,xmax=600,ymax=450]{\filename}; } \setAxis } \end{groupplot} \end{tikzpicture} \end{document} ``` Let's see what this code actually produces. Given four images with the following file names, ``` example_cat_10.jpg example_dog_20.jpg example_duck_30.jpg example_penguin_40.jpg ``` then PGFPlots will automatically title each plot with a name given by the middle part of the image file name: (All four images are from Pixabay.)
0
https://tex.stackexchange.com/users/91603
692468
321,233