How to export the cell above to pdf using the Export[] command (not using GUI)Image of input and output cells is not exported correctlySlideshow export to PDF (landscape)How to highlight the whole selected cellExport to PDF so that Adobe Illustrator does not convert PlotMarkers to fontsSave as PDF without cell numbersSaving all cell-groups to pdfs with filenamesHow to export a cell in Messages console to PDF?
Can I leave my car sitting outside for about 5 years?
Who owns copyright on works found in a storage unit/attic?
1 horizontal and 1 vertical line needs to be a different color in my table
Theoretically, what if I were to change some magic numbers in, say, AES?
What if I take Necrotic damage more than my hit point total?
Is it legal to use True Polymorph to become a really old adult dragon so that you become ancient with time?
Why is JavaScript not compiled to bytecode before sending over the network?
What are the common footprint naming conventions
Why should you have travel insurance?
How do i limit the use of projectiles in a high fantasy world?
Is my ESTA still valid though I've mislaid it?
Which species is proud of being conquered many times?
What are the ethical implications of lying to get into a course?
Why is Brownian motion useful in finance?
Twelve Labours - Conclusion
Expectation of 500 coin flips after 500 realizations
Being heavily recruited at new company: Should I tell them I’m trying to get pregnant?
Windows Defender reports Win64/Longage Trojan malware in Ubuntu 18.04.3 live server
Why does atmospheric pressure act on us?
Why did they design new connectors for USB?
what makes a disease deadly?
Is rotating a pawn so that it faces a different direction and then moves in that direction technically permitted according to the 2018 FIDE Laws?
Can you bring an adjustable spanner on an airplane from Åland?
Simulating these special dice on more regular dice
How to export the cell above to pdf using the Export[] command (not using GUI)
Image of input and output cells is not exported correctlySlideshow export to PDF (landscape)How to highlight the whole selected cellExport to PDF so that Adobe Illustrator does not convert PlotMarkers to fontsSave as PDF without cell numbersSaving all cell-groups to pdfs with filenamesHow to export a cell in Messages console to PDF?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty
margin-bottom:0;
.everyonelovesstackoverflowposition:absolute;height:1px;width:1px;opacity:0;top:0;left:0;pointer-events:none;
$begingroup$
Sorry if this was asked before. I googled and could not find anything.
Many times I need to export a cell to a PDF. It is always the cell above. Currently I do this using the GUI, by selecting the cell first, then File
->Save selection As
then save it to a PDF file.
But sometimes I lose track of what file I saved the cell to (If I do not remember to add a comment).
Is it possible to use the Export command? This way by looking at the command below the cell, I know the name of the file.
With plots and graphics, this is easy to do, since I could do p=Plot[...]
then do Export["plot.pdf",p]
Any suggestions how to do this for cell? It will always be the cell above where the command is issued, if this makes it any easier. (So can't use any hardcoded specific current cell number, since the cell numbers can change when modifying the notebook)
I am using V12 on windows 10.
export cells
$endgroup$
add a comment
|
$begingroup$
Sorry if this was asked before. I googled and could not find anything.
Many times I need to export a cell to a PDF. It is always the cell above. Currently I do this using the GUI, by selecting the cell first, then File
->Save selection As
then save it to a PDF file.
But sometimes I lose track of what file I saved the cell to (If I do not remember to add a comment).
Is it possible to use the Export command? This way by looking at the command below the cell, I know the name of the file.
With plots and graphics, this is easy to do, since I could do p=Plot[...]
then do Export["plot.pdf",p]
Any suggestions how to do this for cell? It will always be the cell above where the command is issued, if this makes it any easier. (So can't use any hardcoded specific current cell number, since the cell numbers can change when modifying the notebook)
I am using V12 on windows 10.
export cells
$endgroup$
$begingroup$
DoesExport["code.pdf", NotebookRead[PreviousCell[]]]
do what you want?
$endgroup$
– Carl Woll
Sep 29 at 2:53
$begingroup$
@CarlWoll Yes !, thank you, that is very good command. If you post that as answer, will be happy to accept it.
$endgroup$
– Nasser
Sep 29 at 2:58
add a comment
|
$begingroup$
Sorry if this was asked before. I googled and could not find anything.
Many times I need to export a cell to a PDF. It is always the cell above. Currently I do this using the GUI, by selecting the cell first, then File
->Save selection As
then save it to a PDF file.
But sometimes I lose track of what file I saved the cell to (If I do not remember to add a comment).
Is it possible to use the Export command? This way by looking at the command below the cell, I know the name of the file.
With plots and graphics, this is easy to do, since I could do p=Plot[...]
then do Export["plot.pdf",p]
Any suggestions how to do this for cell? It will always be the cell above where the command is issued, if this makes it any easier. (So can't use any hardcoded specific current cell number, since the cell numbers can change when modifying the notebook)
I am using V12 on windows 10.
export cells
$endgroup$
Sorry if this was asked before. I googled and could not find anything.
Many times I need to export a cell to a PDF. It is always the cell above. Currently I do this using the GUI, by selecting the cell first, then File
->Save selection As
then save it to a PDF file.
But sometimes I lose track of what file I saved the cell to (If I do not remember to add a comment).
Is it possible to use the Export command? This way by looking at the command below the cell, I know the name of the file.
With plots and graphics, this is easy to do, since I could do p=Plot[...]
then do Export["plot.pdf",p]
Any suggestions how to do this for cell? It will always be the cell above where the command is issued, if this makes it any easier. (So can't use any hardcoded specific current cell number, since the cell numbers can change when modifying the notebook)
I am using V12 on windows 10.
export cells
export cells
edited Sep 29 at 2:27
Nasser
asked Sep 29 at 2:21
NasserNasser
72.9k4 gold badges95 silver badges219 bronze badges
72.9k4 gold badges95 silver badges219 bronze badges
$begingroup$
DoesExport["code.pdf", NotebookRead[PreviousCell[]]]
do what you want?
$endgroup$
– Carl Woll
Sep 29 at 2:53
$begingroup$
@CarlWoll Yes !, thank you, that is very good command. If you post that as answer, will be happy to accept it.
$endgroup$
– Nasser
Sep 29 at 2:58
add a comment
|
$begingroup$
DoesExport["code.pdf", NotebookRead[PreviousCell[]]]
do what you want?
$endgroup$
– Carl Woll
Sep 29 at 2:53
$begingroup$
@CarlWoll Yes !, thank you, that is very good command. If you post that as answer, will be happy to accept it.
$endgroup$
– Nasser
Sep 29 at 2:58
$begingroup$
Does
Export["code.pdf", NotebookRead[PreviousCell[]]]
do what you want?$endgroup$
– Carl Woll
Sep 29 at 2:53
$begingroup$
Does
Export["code.pdf", NotebookRead[PreviousCell[]]]
do what you want?$endgroup$
– Carl Woll
Sep 29 at 2:53
$begingroup$
@CarlWoll Yes !, thank you, that is very good command. If you post that as answer, will be happy to accept it.
$endgroup$
– Nasser
Sep 29 at 2:58
$begingroup$
@CarlWoll Yes !, thank you, that is very good command. If you post that as answer, will be happy to accept it.
$endgroup$
– Nasser
Sep 29 at 2:58
add a comment
|
1 Answer
1
active
oldest
votes
$begingroup$
You can use PreviousCell
for this purpose. For example:
Export["code.pdf", NotebookRead[PreviousCell[]]]
should grab the cell contents of the previous cell, and save it to your file.
$endgroup$
add a comment
|
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "387"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f207036%2fhow-to-export-the-cell-above-to-pdf-using-the-export-command-not-using-gui%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
You can use PreviousCell
for this purpose. For example:
Export["code.pdf", NotebookRead[PreviousCell[]]]
should grab the cell contents of the previous cell, and save it to your file.
$endgroup$
add a comment
|
$begingroup$
You can use PreviousCell
for this purpose. For example:
Export["code.pdf", NotebookRead[PreviousCell[]]]
should grab the cell contents of the previous cell, and save it to your file.
$endgroup$
add a comment
|
$begingroup$
You can use PreviousCell
for this purpose. For example:
Export["code.pdf", NotebookRead[PreviousCell[]]]
should grab the cell contents of the previous cell, and save it to your file.
$endgroup$
You can use PreviousCell
for this purpose. For example:
Export["code.pdf", NotebookRead[PreviousCell[]]]
should grab the cell contents of the previous cell, and save it to your file.
answered Sep 29 at 3:00
Carl WollCarl Woll
99.1k4 gold badges137 silver badges250 bronze badges
99.1k4 gold badges137 silver badges250 bronze badges
add a comment
|
add a comment
|
Thanks for contributing an answer to Mathematica Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f207036%2fhow-to-export-the-cell-above-to-pdf-using-the-export-command-not-using-gui%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
$begingroup$
Does
Export["code.pdf", NotebookRead[PreviousCell[]]]
do what you want?$endgroup$
– Carl Woll
Sep 29 at 2:53
$begingroup$
@CarlWoll Yes !, thank you, that is very good command. If you post that as answer, will be happy to accept it.
$endgroup$
– Nasser
Sep 29 at 2:58